// ----------------  detects screen resolution and assign width to maintable according to resolution - width (size) of window does not impact screen resolution ---------------------

function detectUserScreenResolution()            
{
var width=0;

		

width=determineClientSize();            // function returns the window size of the client i.e. actual width not resolution


//var width=screen.width;                 // returns horizontal resolution but not required as dynamic window size is taken as width
//var height = screen.height;              // don't need this parameter
//alert(width);



var referenceToMainTable=document.getElementById('maintable');                    // returns reference to passed id as per w3c standards


if(width<=1024)                             // resolution 1024 or less
	{
		//alert("<=1024");
		referenceToMainTable.width=1002;
		referenceToMainTable.align="left";
	}

else if(width>=1680)
	{
		//alert(">=1680");
		referenceToMainTable.width=(width-250);
		referenceToMainTable.align="center";
		referenceToMainTable.className="higherresolution";
		
	}


else if((width>=1440) && (width<1680))
	{
		//alert(">=1440 and < 1680");
		referenceToMainTable.width=(width-200);
		referenceToMainTable.align="center";
		referenceToMainTable.className="higherresolution";
		
	}


else if((width>=1360) && (width<1440))
	{
		//alert(">=1360 and < 1440");
		referenceToMainTable.width=(width-150);
		referenceToMainTable.align="center";
		referenceToMainTable.className="higherresolution";
		
	}


else if((width>=1280) && (width<1360))
	{
		//alert(">=1280 and < 1360");
		referenceToMainTable.width=(width-100);
		referenceToMainTable.align="center";
		referenceToMainTable.className="higherresolution";
		
	}

else if((width>=1152) && (width<1280))
	{
		//alert(">=1152 and < 1280 ");
		referenceToMainTable.width=(width-30);
		referenceToMainTable.align="center";
		referenceToMainTable.className="higherresolution";
		
	}

	else
	{
		//alert("No Condition matched");
	}


}       // ------------ function ends


//----------------------- Function to determine size of window ------------------------------------------

function determineClientSize()
{
	return(document.body.clientWidth);                    // returns actual size of the window and not resolution so that if this webpage is opened in non-maximised window then the webpage should adjust its width according to window size

}







//------------------------- Function to detect changes in window size -----------------------



function windowResize()
{
//	alert("resize");
	detectUserScreenResolution();
}





//--------------------------------------------------------------------- Tool Tip Function Section Not USED--------------------------------------------------------










function featureOver(myID)
{
/*
var fName1="Rank";
var fDes1="The overall postion achieved by a filter. 1 is Highest rank and 13 is lowest";



var mouseX, mouseY;
mouseX=event.x;
mouseY=(event.y);

//alert(mouseX);
//alert(mouseY);


var referenceToID0=document.getElementById('ttip0');                    // returns reference to passed id as per w3c standards
var referenceToID=document.getElementById('ttip1');                    // returns reference to passed id as per w3c standards

var referenceToID1=document.getElementById('toolTipTable');                    // returns reference to passed id as per w3c standards

	switch(myID)
	{

	case "f1" :


		referenceToID1.style.visibility="visible";				
		referenceToID1.style.left=0;				
		referenceToID1.style.top=0;				
		referenceToID0.innerText=fName1;
		referenceToID.innerText=fDes1;
		break;





	}                       //    ------------------- switch closed




*/

}




function featureOut(myID)
{

/*
var referenceToID1=document.getElementById('toolTipTable');                    // returns reference to passed id as per w3c standards

referenceToID1.style.visibility="hidden";				
*/

}




//------------------------------------------------------------------ Tool Tip Function Section ENDS --------------------------------------------------------
















//------------------------------------------------------ Read more Image animation Section ------------------------------------------------------------------------------------



function readMoreAnimationStart(rmID)
{
var referenceToID=document.getElementById(rmID);                    // returns reference to passed id as per w3c standards

referenceToID.style.width=64;

}


function readMoreAnimationStop(rmID)
{
var referenceToID=document.getElementById(rmID);                    // returns reference to passed id as per w3c standards

referenceToID.style.width=60;


}



//------------------------------------------------------ Read more Image animation Section ENDS------------------------------------------------------------------------------------





//------------------------------------ Description View / HIDE  Functions ---------------------------------------------------------


function viewDescription(dID)
{

referenceToID1=document.getElementById(dID);                    // returns reference to passed id as per w3c standards
referenceToID1.style.position="relative";
referenceToID1.style.visibility="visible";
}


function hideDescription(dID)
{

referenceToID1=document.getElementById(dID);                    // returns reference to passed id as per w3c standards
referenceToID1.style.position="absolute";
referenceToID1.style.visibility="hidden";
}








//------------------------------------ Description View / HIDE  Functions ENDS---------------------------------------------------------







//------------------------------------------------------------Contact Us Submit Function ------------------------


function submitEnquiry()
{


var invalidFlag=false;                 // initialization

nameL=window.document.ContactUs_Form.nameTextBox.value.length;     // variables followed by letter L hold length of value of var



emailL=window.document.ContactUs_Form.emailTextBox.value.length;

enquiryL=window.document.ContactUs_Form.enquiryMessage.value.length;


var emailText=window.document.ContactUs_Form.emailTextBox.value;

var securityCodeL=window.document.ContactUs_Form.captcha.value.length;


	if((nameL<2) && (invalidFlag==false))
	{
		alert("Please enter your Name");
		invalidFlag=true;
		nameL=window.document.ContactUs_Form.nameTextBox.focus();
	}





	if((emailL<6) && (invalidFlag==false))
	{
		alert("Please enter your Email");
		invalidFlag=true;
		window.document.ContactUs_Form.emailTextBox.focus();
	}




var val1=emailText.indexOf("@");              // for existence of @ in email address

var val2=emailText.indexOf(".");                  // for existence of . in email address

var val3=emailText.indexOf(" ");                  // for existence of <space> in email address


	if(((val1==-1) || (val2==-1) || (val3!=-1)) && invalidFlag==false)                    // -1 will be returned if @ or . is missing from email address
	{
		alert("Please enter Correct Email Address");
		invalidFlag=true;
		window.document.ContactUs_Form.emailTextBox.focus();
	}



	if((enquiryL<2) && (invalidFlag==false))
	{
		alert("Please enter your Question");
		invalidFlag=true;
		window.document.ContactUs_Form.enquiryMessage.focus();
	}

	if((securityCodeL<5) && (invalidFlag==false))
	{
		alert("Please enter 5 digit Security Code");
		invalidFlag=true;
		window.document.ContactUs_Form.captcha.focus();
	}



	if(invalidFlag==false)
	{
	//alert("submit");
	window.document.ContactUs_Form.submit();
	}



}// Function closed





//----------------------------------------------- Advertisement Clicked Not Used -----------------------------------------


function adClicked()
{

alert("hello");

}





