
// Press release print

function printDiv (id) { 

    // open popup in center of browser
         var w = 800, h = 600;
       
        if (document.all) {
           /* the following is only available after onLoad */
           w = document.body.clientWidth;
           h = document.body.clientHeight;
        }
        else if (document.layers) {
           w = window.innerWidth;
           h = window.innerHeight;
        }
        else
        {
           w = document.body.clientWidth;
           h = document.body.clientHeight;
        }

        var popW = 750, popH = 700;

        var leftPos = (w-popW)/2;
        var topPos = (h-popH)/2;
        topPos = topPos - 200;
         
    var popupproperty = "status=yes,toolbar=no,menubar=no,location=center,scrollbars=yes," + "width=" + popW + ",height="+popH+",top="+topPos+",left="+leftPos;
    var printcontent = document.getElementById(id).innerHTML;
    var printwindow = window.open("pressprint.html",null,popupproperty);

}


//Form Validations : Priyanka

// test variables
var myHeight = 200;
var isResizable = true;

function createTarget(form) {
_target = form.target;
_colon = _target.indexOf(":");
if(_colon != -1) {
form.target = _target.substring(0,_colon);
form.args = _target.substring(_colon+1);
} else if(typeof(form.args)=="undefined") {
form.args = "";
}
if(form.args.indexOf("{")!=-1) {
_args = form.args.split("{");
form.args = _args[0];
for(var i = 1; i < _args.length;i++) {
_args[i] = _args[i].split("}");
form.args += eval(_args[i][0]) + _args[i][1];
   }
}
form.args = form.args.replace(/ /g,"");
_win = window.open('',form.target,form.args);
if(typeof(focus)=="function")
_win.focus();
return true;
}
//  End -->


function Trim(str)
{  while(str.charAt(0) == (" ") )
  {  str = str.substring(1);
  }
  while(str.charAt(str.length-1) == " " )
  {  str = str.substring(0,str.length-1);
  }
  return str;
}


function FormValidation()
{
var inputName = Trim(document.getElementById('Name').value);
var inputCompany = Trim(document.getElementById('Company').value);
var inputEmail = Trim(document.getElementById('Email').value);
var inputCountry = Trim(document.getElementById('Country').value);
var alertflag = false;
var alertMsg = "Please fill the required fields:\n";
var focusflag = true;

if(inputName.length<=0)
{

alertMsg = alertMsg + "- Name\n";
alertflag = true;
if(focusflag == true)
{
document.getElementById('Name').focus();
focusflag = false
}

}
if(inputCompany.length<=0)
{

alertMsg = alertMsg + "- Company\n";
alertflag = true;
if(focusflag == true)
{
document.getElementById('Company').focus();
focusflag = false
}

}
if(inputEmail.length<=0)
{

alertMsg = alertMsg + "- Email\n";
alertflag = true;

if(focusflag == true)
{
document.getElementById('Email').focus();
focusflag = false
}

}
if(inputCountry.length<=0)
{

alertMsg = alertMsg + "- Country\n";
alertflag = true;

if(focusflag == true)
{
document.getElementById('Country').focus();
focusflag = false
}

}

if(alertflag==true)
{
    alert(alertMsg);
    return false;
}

// open popup in center of browser
         var w = 800, h = 600;
       
        if (document.all) {
           /* the following is only available after onLoad */
           w = document.body.clientWidth;
           h = document.body.clientHeight;
        }
        else if (document.layers) {
           w = window.innerWidth;
           h = window.innerHeight;
        }
        else
        {
           w = document.body.clientWidth;
           h = document.body.clientHeight;
        }

        var popW = 750, popH = 700;

        var leftPos = (w-popW)/2;
        var topPos = (h-popH)/2;
        topPos = topPos - 200;
        
document.getElementById('form').target = "fb:status=yes,toolbar=no,menubar=no,location=center,scrollbars=yes," + "width=" + popW + ",height="+popH+",top="+topPos+",left="+leftPos;
createTarget(document.getElementById('form'));

return true;
}


// This is the Google Analytics Script
var pageTracker = _gat._getTracker("UA-4669076-1");
//pageTracker._setLocalRemoteServerMode(); 
pageTracker._initData();
pageTracker._trackPageview();
// End Google Analytics 


