//this function is used for disabling ctrl + c
// Start Popup Quick Contact

var domainroot="www.iqspl.com"

function Gsitesearch(curobj){
curobj.q.value="site:"+domainroot+" "+curobj.qfront.value
}

function clearTextSearch(id) {
	
document.getElementById(id).value = "";
	}

function setText(id) {
	if(document.getElementById(id).value =="")
    document.getElementById(id).value="Search";
}
function opacity(id, opacStart, opacEnd, millisec,display) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
		document.getElementById("QC").style.display=display;
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
		document.getElementById("QC").style.display=display;
	}
	
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}



function popQuick()
	{
		//alert("in popQuick");
        
	opacity("QC", 0, 100, 1200,"block")	
	
	}
	function closePop()
	{
		//alert("in closePop");
		validateForm();
		parent.opacity("QC", 100, 0, 2000,"none")
		
	}
	
// End Popup Quick Contact
function Disable_Control_C(evt) {
	
	var e = (window.event) ? window.event : evt;
	var keystroke = String.fromCharCode(e.keyCode).toLowerCase();

	if (e.ctrlKey && keystroke == 'c') {
		
		e.returnValue = false; // disable Ctrl+C
		return false;
	}
}

//code for disabling right click

var isNS = (navigator.appName == "Netscape") ? 1 : 0;
  if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
  function mischandler(){
   return false;
 }
  function mousehandler(e){
 	var myevent = (isNS) ? e : event;
 	var eventbutton = (isNS) ? myevent.which : myevent.button;
    if((eventbutton==2)||(eventbutton==3)) return false;
 }
 document.oncontextmenu = mischandler;
 document.onmousedown = mousehandler;
 document.onmouseup = mousehandler;

/*function changeCSSTheme(color)
{	
	document.cookie = "name="+'css/'+color+'theme.css'+";"; 
	document.getElementById('cssThemes').href = 'css/'+color+'theme.css'; 
	
	//alert(document.getElementById('cssThemes').href);
}

function getCSSTheme()
{
//	document.cookie = "name="+'css/'+color+'theme.css'+";"; 
	//alert(document.getElementById('cssThemes').href);
	/*var cssTheme = document.cookie.split("=")[1];
	//.alert(cssTheme);
	if(cssTheme!="" && cssTheme!= null )
	{
		document.getElementById('cssThemes').href = cssTheme;
		//alert(document.getElementById('cssThemes').href);
	} else	{
		document.getElementById('cssThemes').href = "css/bluetheme.css";
	}
	
}
*/

function clearText(id){		
		document.getElementById(id).value = "";
}

/*window.onbeforeunload = function (evt) {
  var message = 'Are you sure you want to leave?';
  if (typeof evt == 'undefined') {
    evt = window.event;
  }
  if (evt) {
    evt.returnValue = message;
  }
  return message;
}*/

/* Function to open PDF file */
function PopupCenter(pageURL, title,w,h) {	
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var targetWin = window.open (pageURL, title, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=' + w + ',height=' + h + ',top=' + top + ',left=' + left);
	
}

/* Function to zoom in and zoom out image */
var nW,nH,oH,oW;
function zoom(iWideSmall,iHighSmall,iWideLarge,iHighLarge,whichImage)
{
	oW=whichImage.style.width;oH=whichImage.style.height;
	if((oW==iWideLarge)||(oH==iHighLarge))
	{
		nW=iWideSmall;nH=iHighSmall;
	}
	else
	{
		nW=iWideLarge;nH=iHighLarge;
	}
	whichImage.style.width=nW;whichImage.style.height=nH;
}

/* Function for e-mail button on home page. */
function emailReceived() {
	
}


/* Function for textbox style added by Padmaja on 10/10/2009 */
function changetext_style(id){			
	document.getElementById(id).style.cssText = "border:2px solid #E0F2F6;";			
}

function changetextarea_style(id){			
	document.getElementById(id).style.cssText = "border:2px solid #E0F2F6; width:410px; height:90px;";			
}

function text_style(id){			
	document.getElementById(id).style.cssText = "border:1px solid #7F9DB9;";			
}

function textarea_style(id){			
	document.getElementById(id).style.cssText = "border:1px solid #7F9DB9; width:410px; height:90px;";			
}


function validateThis(){
                var frm = document.forms[0];
                if(frm.q.value=="" && frm.q.value.length <1){
                    alert("Please enter text to search.");
                    frm.q.focus();
                    return false;

                }
                return true;

            }

  function clearname(id)
            {

                if(document.getElementById(id).value=='Name')
                {
                document.getElementById(id).value="";
                }
            }
  function putname(id)
  {
   if(document.getElementById(id).value=='')
    {
      document.getElementById(id).value="Name";
    }

  }

   function clearmobno(id)
            {

                if(document.getElementById(id).value=='Mobile No')
                {
                document.getElementById(id).value="";
                }
            }
             function putmobileno(id)
            {
               if(document.getElementById(id).value=='')
                {
                document.getElementById(id).value="Mobile No";
                }

            }
            function clearemail(id)
            {
                
                if(document.getElementById(id).value=='Email')
                {
                document.getElementById(id).value="";
                }
            }
             function putemail(id)
            {
               if(document.getElementById(id).value=='')
                {
                document.getElementById(id).value="Email";
                }

            }
            function clearprovidecomment(id)
            {

                if(document.getElementById(id).value=='Provide Comment')
                {
                document.getElementById(id).value="";
                }
            }
             function putprovidecomment(id)
            {
               if(document.getElementById(id).value=='')
                {
                document.getElementById(id).value="Provide Comment";
                }

            }
