/*

		title:    		  IPP for futuristic eSolutions

		author:   		  anil@futuristiceSolutions.com

		updated:  		  dec 21 2007		

*/



//PAGE LOAD SPEED

	// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/

	loadtime="0"

	loading=true

	s="s"

	{refresh()}

	function refresh()

	{setTimeout("count()",250)}

	function count()

	{if (loading)

	{loadtime=loadtime+++0.25;refresh()}}

	function done()

	{if (loadtime==1)

	{s=""}

	alert("It took "+loadtime+" second"+s+" to load the page");loading=false}

//PAGE LOAD SPEED



// CURRENT DAY AND DATE - appears in the lasttable.php

var mydate=new Date()

					var theYear=mydate.getFullYear()

					var day=mydate.getDay()

					var month=mydate.getMonth()

					var daym=mydate.getDate()

				

					if (daym<10)

						daym="0"+daym

						var dayarray=new Array("<b>Sunday</b>","<b>Monday</b>","<b>Tuesday</b>","<b>Wednesday</b>","<b>Thursday</b>","<b>Friday</b>","<b>Saturday</b>")

						var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12")

// CURRENT DAY AND DATE - appears in the lasttable.php

//---------------------

// Swap

//--------------------

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}





//-----------------------------------------------------------------------------

// NewsLetter

//-----------------------------------------------------------------------------



function newsletterHome()

{

	if (window.document.FormNews.email_tb.value.indexOf('.')=="-1" || window.document.FormNews.email_tb.value.indexOf('@')=="-1")

	{

	alert("Please enter your Email properly!")

	window.document.FormNews.email_tb.focus();

	return false; 

	}

	else{

    document.FormNews.action="http://www.indianprinterpublisher.com/newsletter.php";

    document.FormNews.submit();

	return true; 

    }



}



function newsletter()

{

	if(document.FormNews.nametxt.value==''){

    document.FormNews.nametxt.focus();

    alert("Please make sure Name is not left blank");

   	return false;

    }

		if (window.document.FormNews.email_tb.value.indexOf('.')=="-1" || window.document.FormNews.email_tb.value.indexOf('@')=="-1")

	{

	alert("Please enter your Email properly!")

	window.document.FormNews.email_tb.focus();

	return false; }

	else{

    document.FormNews.action="newsletter-confirm.php";

    document.FormRequest.submit();

    }



}



//** Tab Content script v2.0- © anil@futuristiceSolutions.com





////NO NEED TO EDIT BELOW////////////////////////



function ddtabcontent(tabinterfaceid){

	this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container

	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container

	this.enabletabpersistence=true

	this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container

	this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)

	this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)

	this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")

}



ddtabcontent.getCookie=function(Name){ 

	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair

	if (document.cookie.match(re)) //if cookie found

		return document.cookie.match(re)[0].split("=")[1] //return its value

	return ""

}



ddtabcontent.setCookie=function(name, value){

	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)

}



ddtabcontent.prototype={



	expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers

		this.cancelautorun() //stop auto cycling of tabs (if running)

		var tabref=""

		try{

			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr

				tabref=document.getElementById(tabid_or_position)

			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr

				tabref=this.tabs[tabid_or_position]

		}

		catch(err){alert("Invalid Tab ID or position entered!")}

		if (tabref!="") //if a valid tab is found based on function parameter

			this.expandtab(tabref) //expand this tab

	},



	setpersist:function(bool){ //PUBLIC function to toggle persistence feature

			this.enabletabpersistence=bool

	},



	setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")

		this.selectedClassTarget=objstr || "link"

	},



	getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to

		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref

	},



	expandtab:function(tabref){

		var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand

		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through

		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""

		this.expandsubcontent(subcontentid)

		this.expandrevcontent(associatedrevids)

		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"

			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""

		}

		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers

			ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)

	},



	expandsubcontent:function(subcontentid){

		for (var i=0; i<this.subcontentids.length; i++){

			var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)

			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value

		}

	},





	expandrevcontent:function(associatedrevids){

		var allrevids=this.revcontentids

		for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface

			//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it

			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"

		}

	},



	autorun:function(){ //function to auto cycle through and select tabs based on a set interval

		var currentTabIndex=this.automode_currentTabIndex //index within this.hottabspositions to begin

		var hottabspositions=this.hottabspositions //Array containing position numbers of "hot" tabs (those with a "rel" attr)

		this.expandtab(this.tabs[hottabspositions[currentTabIndex]])

		this.automode_currentTabIndex=(currentTabIndex<hottabspositions.length-1)? currentTabIndex+1 : 0 //increment currentTabIndex

	},



	cancelautorun:function(){

		if (typeof this.autoruntimer!="undefined")

			clearInterval(this.autoruntimer)

	},



	init:function(automodeperiod){

		var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)

		var persisterror=true //Bool variable to check whether persisted tab position is valid (can become invalid if user has modified tab structure)

		this.automodeperiod=automodeperiod || 0

		for (var i=0; i<this.tabs.length; i++){

			this.tabs[i].tabposition=i //remember position of tab relative to its peers

			if (this.tabs[i].getAttribute("rel")){

				var tabinstance=this

				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers

				this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)

				this.tabs[i].onclick=function(){

					tabinstance.expandtab(this)

					tabinstance.cancelautorun() //stop auto cycling of tabs (if running)

					return false

				}

				if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element

					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))

				}

				if (this.enabletabpersistence && parseInt(persistedtab)==i || !this.enabletabpersistence && this.getselectedClassTarget(this.tabs[i]).className=="selected"){

					this.expandtab(this.tabs[i]) //expand current tab if it's the persisted tab, or if persist=off, carries the "selected" CSS class

					persisterror=false //Persisted tab (if applicable) was found, so set "persisterror" to false

					//If currently selected tab's index(i) is greater than 0, this means its not the 1st tab, so set the tab to begin in automode to 1st tab:

					this.automode_currentTabIndex=(i>0)? 0 : 1

				}

			}

		} //END for loop

		if (persisterror) //if an error has occured while trying to retrieve persisted tab (based on its position within its peers)

			this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr

		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){

			this.automode_currentTabIndex=this.automode_currentTabIndex || 0

			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)

		}

	} //END int() function



} //END Prototype assignment



//** Featured Content Slider script- © anil@futuristiceSolutions.com



////Ajax related settings

var csbustcachevar=0 //bust potential caching of external pages after initial Ajax request? (1=yes, 0=no)

var enabletransition=1 //enable fade into view transition effect? (1=yes, 0=no)

var csloadstatustext="<img src='../images/loading.gif' /> Requesting content..." //HTML to indicate Ajax page is being fetched

var csexternalfiles=[] //External .css or .js files to load to style the external content(s), if any. Separate multiple files with comma ie: ["cat.css", dog.js"]



////NO NEED TO EDIT BELOW////////////////////////

var enablepersist=true

var slidernodes=new Object() //Object array to store references to each content slider's DIV containers (<div class="contentdiv">)

var csloadedobjects="" //Variable to store file names of .js/.css files already loaded (if Ajax is used)



function ContentSlider(sliderid, autorun, customPaginateText, customNextText){

	var slider=document.getElementById(sliderid)

	if (typeof customPaginateText!="undefined" && customPaginateText!="") //Custom array of pagination links text defined?

		slider.paginateText=customPaginateText

	if (typeof customNextText!="undefined" && customNextText!="") //Custom HTML for "Next" link defined?

		slider.nextText=customNextText

	slidernodes[sliderid]=[] //Array to store references to this content slider's DIV containers (<div class="contentdiv">)

	ContentSlider.loadobjects(csexternalfiles) //Load external .js and .css files, if any

	var alldivs=slider.getElementsByTagName("div")

	for (var i=0; i<alldivs.length; i++){

		if (alldivs[i].className=="opacitylayer")

			slider.opacitylayer=alldivs[i]

		else if (alldivs[i].className=="contentdiv"){

			slidernodes[sliderid].push(alldivs[i]) //add this DIV reference to array

			if (typeof alldivs[i].getAttribute("rel")=="string") //If get this DIV's content via Ajax (rel attr contains path to external page)

				ContentSlider.ajaxpage(alldivs[i].getAttribute("rel"), alldivs[i])

		}

	}

	ContentSlider.buildpagination(sliderid)

	var loadfirstcontent=true

	if (enablepersist && getCookie(sliderid)!=""){ //if enablepersist is true and cookie contains corresponding value for slider

		var cookieval=getCookie(sliderid).split(":") //process cookie value ([sliderid, int_pagenumber (div content to jump to)]

		if (document.getElementById(cookieval[0])!=null && typeof slidernodes[sliderid][cookieval[1]]!="undefined"){ //check cookie value for validity

			ContentSlider.turnpage(cookieval[0], parseInt(cookieval[1])) //restore content slider's last shown DIV

			loadfirstcontent=false

		}

	}

	if (loadfirstcontent==true) //if enablepersist is false, or cookie value doesn't contain valid value for some reason (ie: user modified the structure of the HTML)

		ContentSlider.turnpage(sliderid, 0) //Display first DIV within slider

	if (typeof autorun=="number" && autorun>0) //if autorun parameter (int_miliseconds) is defined, fire auto run sequence

		window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorun)}, autorun)

}



ContentSlider.buildpagination=function(sliderid){

	var slider=document.getElementById(sliderid)

	var paginatediv=document.getElementById("paginate-"+sliderid) //reference corresponding pagination DIV for slider

	var pcontent=""

	for (var i=0; i<slidernodes[sliderid].length; i++) //For each DIV within slider, generate a pagination link

		pcontent+='<a href="#" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', '+i+'); return false\">'+(slider.paginateText? slider.paginateText[i] : i+1)+'</a> '

	pcontent+='<a href="#"  onClick=\"ContentSlider.turnpage(\''+sliderid+'\', parseInt(this.getAttribute(\'rel\'))); return false\">'+(slider.nextText || "Next")+'</a>'

	paginatediv.innerHTML=pcontent

	paginatediv.onclick=function(){ //cancel auto run sequence (if defined) when user clicks on pagination DIV

	if (typeof window[sliderid+"timer"]!="undefined")

		clearTimeout(window[sliderid+"timer"])

	}

}



ContentSlider.turnpage=function(sliderid, thepage){

	var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //gather pagination links

	for (var i=0; i<slidernodes[sliderid].length; i++){ //For each DIV within slider

		paginatelinks[i].className="" //empty corresponding pagination link's class name

		slidernodes[sliderid][i].style.display="none" //hide DIV

	}

	paginatelinks[thepage].className="selected" //for selected DIV, set corresponding pagination link's class name

	if (enabletransition){

		if (window[sliderid+"fadetimer"])

			clearTimeout(window[sliderid+"fadetimer"])

		this.setopacity(sliderid, 0.1)

	}

	slidernodes[sliderid][thepage].style.display="block" //show selected DIV

	if (enabletransition)

		this.fadeup(sliderid, thepage)

	//Set "Next" pagination link's (last link within pagination DIV) "rel" attribute to the next DIV number to show

	paginatelinks[paginatelinks.length-1].setAttribute("rel", thenextpage=(thepage<paginatelinks.length-2)? thepage+1 : 0)

	if (enablepersist)

		setCookie(sliderid, sliderid+":"+thepage)

}



ContentSlider.autoturnpage=function(sliderid, autorunperiod){

	var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //Get pagination links

	var nextpagenumber=parseInt(paginatelinks[paginatelinks.length-1].getAttribute("rel")) //Get page number of next DIV to show

	ContentSlider.turnpage(sliderid, nextpagenumber) //Show that DIV

	window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorunperiod)}, autorunperiod)

}



ContentSlider.setopacity=function(sliderid, value){ //Sets the opacity of targetobject based on the passed in value setting (0 to 1 and in between)

	var targetobject=document.getElementById(sliderid).opacitylayer || null //reference slider container itself

	if (targetobject && targetobject.filters && targetobject.filters[0]){ //IE syntax

		if (typeof targetobject.filters[0].opacity=="number") //IE6

			targetobject.filters[0].opacity=value*100

		else //IE 5.5

			targetobject.style.filter="alpha(opacity="+value*100+")"

		}

	else if (targetobject && typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax

		targetobject.style.MozOpacity=value

	else if (targetobject && typeof targetobject.style.opacity!="undefined") //Standard opacity syntax

		targetobject.style.opacity=value

	targetobject.currentopacity=value

}



ContentSlider.fadeup=function(sliderid){

	var targetobject=document.getElementById(sliderid).opacitylayer || null //reference slider container itself

	if (targetobject && targetobject.currentopacity<1){

		this.setopacity(sliderid, targetobject.currentopacity+0.1)

		window[sliderid+"fadetimer"]=setTimeout(function(){ContentSlider.fadeup(sliderid)}, 100)

	}

}



function getCookie(Name){ 

	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair

	if (document.cookie.match(re)) //if cookie found

		return document.cookie.match(re)[0].split("=")[1] //return its value

	return ""

}



function setCookie(name, value){

	document.cookie = name+"="+value

}



////////////////Ajax Related functions //////////////////////////////////



ContentSlider.ajaxpage=function(url, thediv){

	var page_request = false

	var bustcacheparameter=""

	if (window.XMLHttpRequest) // if Mozilla, Safari etc

		page_request = new XMLHttpRequest()

	else if (window.ActiveXObject){ // if IE

		try {

		page_request = new ActiveXObject("Msxml2.XMLHTTP")

		} 

		catch (e){

		try{

		page_request = new ActiveXObject("Microsoft.XMLHTTP")

		}

		catch (e){}

		}

	}

	else

		return false

	thediv.innerHTML=csloadstatustext

	page_request.onreadystatechange=function(){

		ContentSlider.loadpage(page_request, thediv)

	}

	if (csbustcachevar) //if bust caching of external page

		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()

	page_request.open('GET', url+bustcacheparameter, true)

	page_request.send(null)

}



ContentSlider.loadpage=function(page_request, thediv){

	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))

		thediv.innerHTML=page_request.responseText

}



ContentSlider.loadobjects=function(externalfiles){ //function to load external .js and .css files. Parameter accepts a list of external files to load (array)

	for (var i=0; i<externalfiles.length; i++){

		var file=externalfiles[i]

		var fileref=""

		if (csloadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding

			if (file.indexOf(".js")!=-1){ //If object is a js file

				fileref=document.createElement('script')

				fileref.setAttribute("type","text/javascript");

				fileref.setAttribute("src", file);

			}

			else if (file.indexOf(".css")!=-1){ //If object is a css file

				fileref=document.createElement("link")

				fileref.setAttribute("rel", "stylesheet");

				fileref.setAttribute("type", "text/css");

				fileref.setAttribute("href", file);

			}

		}

		if (fileref!=""){

			document.getElementsByTagName("head").item(0).appendChild(fileref)

			csloadedobjects+=file+" " //Remember this object as being already added to page

		}

	}

}

//-----------------------------------------------------------------------------

// Date Script

//-----------------------------------------------------------------------------



function current_date()

{

var day=new Array();

day[0]="Sunday";day[1]="Monday";day[2]="Tuesday";day[3]="Wednesday";day[4]="Thursday";day[5]="Friday";day[6]="Saturday";

var months=new Array(13);

months[0]="January";

months[1]="February";

months[2]="March";

months[3]="April";

months[4]="May";

months[5]="June";

months[6]="July";

months[7]="August";

months[8]="September";

months[9]="October";

months[10]="November";

months[11]="December";

var time=new Date();

var lmonth=months[time.getMonth()];

var tday=day[time.getDay()];

var date=time.getDate();

var year=time.getYear();

if (year < 2000)

year = year + 1900;

document.write("<font color='#FFFFFF' face='Verdana, Arial, Helvetica, sans-serif' font-size=10px> <b>"+tday+",&nbsp; "+lmonth+" "+date+",&nbsp; "+year+"</font> </b>");

}



//---------------

// Swith menu

//-------------

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)

var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only



if (document.getElementById){ //DynamicDrive.com change

document.write('<style type="text/css">\n')

document.write('.submenu{display: none;}\n')

document.write('</style>\n')

}



function SwitchMenu(obj){

	if(document.getElementById){

	var el = document.getElementById(obj);

	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change

		if(el.style.display != "block"){ //DynamicDrive.com change

			for (var i=0; i<ar.length; i++){

				if (ar[i].className=="submenu") //DynamicDrive.com change

				ar[i].style.display = "none";

			}

			el.style.display = "block";

		}else{

			el.style.display = "none";

		}

	}

}



function get_cookie(Name) { 

var search = Name + "="

var returnvalue = "";

if (document.cookie.length > 0) {

offset = document.cookie.indexOf(search)

if (offset != -1) { 

offset += search.length

end = document.cookie.indexOf(";", offset);

if (end == -1) end = document.cookie.length;

returnvalue=unescape(document.cookie.substring(offset, end))

}

}

return returnvalue;

}



function onloadfunction(){

if (persistmenu=="yes"){

var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname

var cookievalue=get_cookie(cookiename)

if (cookievalue!="")

document.getElementById(cookievalue).style.display="block"

}

}



function savemenustate(){

var inc=1, blockid=""

while (document.getElementById("sub"+inc)){

if (document.getElementById("sub"+inc).style.display=="block"){

blockid="sub"+inc

break

}

inc++

}

var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname

var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid

document.cookie=cookiename+"="+cookievalue

}



if (window.addEventListener)

window.addEventListener("load", onloadfunction, false)

else if (window.attachEvent)

window.attachEvent("onload", onloadfunction)

else if (document.getElementById)

window.onload=onloadfunction



if (persistmenu=="yes" && document.getElementById)

window.onunload=savemenustate





//-----------------

// Shadow

//-----------------

var gradientshadow={}

gradientshadow.depth=6 //Depth of shadow in pixels

gradientshadow.containers=[]



gradientshadow.create=function(){

var a = document.all ? document.all : document.getElementsByTagName('*')

for (var i = 0;i < a.length;i++) {

	if (a[i].className == "shadow") {

		for (var x=0; x<gradientshadow.depth; x++){

			var newSd = document.createElement("DIV")

			newSd.className = "shadow_inner"

			newSd.id="shadow"+gradientshadow.containers.length+"_"+x //Each shadow DIV has an id of "shadowL_X" (L=index of target element, X=index of shadow (depth) 

			if (a[i].getAttribute("rel"))

				newSd.style.background = a[i].getAttribute("rel")

			else

				newSd.style.background = "black" //default shadow color if none specified

			document.body.appendChild(newSd)

		}

	gradientshadow.containers[gradientshadow.containers.length]=a[i]

	}

}

gradientshadow.position()

window.onresize=function(){

	gradientshadow.position()

}

}



gradientshadow.position=function(){

if (gradientshadow.containers.length>0){

	for (var i=0; i<gradientshadow.containers.length; i++){

		for (var x=0; x<gradientshadow.depth; x++){

  		var shadowdiv=document.getElementById("shadow"+i+"_"+x)

			shadowdiv.style.width = gradientshadow.containers[i].offsetWidth + "px"

			shadowdiv.style.height = gradientshadow.containers[i].offsetHeight + "px"

			shadowdiv.style.left = gradientshadow.containers[i].offsetLeft + x + "px"

			shadowdiv.style.top = gradientshadow.containers[i].offsetTop + x + "px"

		}

	}

}

}



if (window.addEventListener)

window.addEventListener("load", gradientshadow.create, false)

else if (window.attachEvent)

window.attachEvent("onload", gradientshadow.create)

else if (document.getElementById)

window.onload=gradientshadow.create



//-----------------------------------------------------------------------------

// contact us 

//-----------------------------------------------------------------------------

function feedback()

{

	if(document.FormFeedback.nametxt.value==''){

    document.FormFeedback.nametxt.focus();

    alert("Please make sure Your Name is not left blank");

   	return false;

    }

	if (window.document.FormFeedback.mailtxt.value.indexOf('.')=="-1" || window.document.FormFeedback.mailtxt.value.indexOf('@')=="-1")

	{

	alert("Please enter your Your Email properly!")

	window.document.FormFeedback.mailtxt.focus();

	return false;

	}

	if(document.FormFeedback.textcomm.value==''){

    document.FormFeedback.textcomm.focus();

    alert("Please make sure Comments is not left blank");

   	return false;

    }

	else{

    document.FormFeedback.action="/contact_confirm.php";

    document.FormFeedback.submit();

    }



}

//-----------------------------------------------------------------------------

// Link Exchange

//-----------------------------------------------------------------------------

function link()

{

	if(document.FormLink.name_tb.value==''){

    document.FormLink.name_tb.focus();

    alert("Please make sure Contact Name is not left blank");

   	return false;

    }

	if (window.document.FormLink.email_tb.value.indexOf('.')=="-1" || window.document.FormLink.email_tb.value.indexOf('@')=="-1")

	{

	alert("Please enter your Email properly!")

	window.document.FormLink.email_tb.focus();

	return false;

	}



	if(document.FormLink.title_tb.value==''){

    document.FormLink.title_tb.focus();

    alert("Please make sure Website Tittle is not left blank");

   	return false;

    }



	if(document.FormLink.url_tb.value==''){

    document.FormLink.url_tb.focus();

    alert("Please make sure Website URL is not left blank");

   	return false;

    }



	if(document.FormLink.desc_tb.value==''){

    document.FormLink.desc_tb.focus();

    alert("Please make sure Site Description is not left blank");

   	return false;

    }

	if(document.FormLink.cat_mu.value==''){

    document.FormLink.cat_mu.focus();

    alert("Please make sure Site Catgory is not left blank");

   	return false;

    }

	if(document.FormLink.recipurl_tb.value==''){

    document.FormLink.recipurl_tb.focus();

    alert("Please make sure Reciprocal Link is not left blank");

   	return false;

    }

	

}





////////

// Open window

///////



function scrollWindow(url,mywidth,myheight) {

	var iMyWidth;

	var iMyHeight;

	//gets top and left positions based on user's resolution so hint window is centered.

	iMyWidth = (window.screen.width/2) - ((mywidth/2) + 10); //half the screen width minus half the new window width (plus 5 pixel borders).

	iMyHeight = (window.screen.height/2) - ((myheight/2) + 50); //half the screen height minus half the new window height (plus title and status bars).

	var win2 = window.open(url,"Window3","status=0,height=" + myheight + ",width=" + mywidth + ",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=yes");

	win2.focus();

}



//-----------------------------------------------------------------------------

// jod-offer 

//-----------------------------------------------------------------------------

function offers()

{

	if(document.FormOffers.nameorg.value==''){

    document.FormOffers.nameorg.focus();

    alert("Please make sure Name of the organisation is not left blank");

   	return false;

    }

	if(document.FormOffers.posoff.value==''){

    document.FormOffers.posoff.focus();

    alert("Please make sure Position offered is not left blank");

   	return false;

    }

	if (window.document.FormOffers.email.value.indexOf('.')=="-1" || window.document.FormOffers.email.value.indexOf('@')=="-1")

	{

	alert("Please enter your Your Email properly!")

	window.document.FormOffers.email.focus();

	return false;

	}

	else{

    document.FormOffers.action="offer.php";

    document.FormOffers.submit();

    }



}



//-----------------------------------------------------------------------------

// jod-wanted 

//-----------------------------------------------------------------------------

function wanted()

{

	if(document.FormWanted.name.value==''){

    document.FormWanted.name.focus();

    alert("Please make sure Name is not left blank");

   	return false;

    }

	if (window.document.FormWanted.email.value.indexOf('.')=="-1" || window.document.FormWanted.email.value.indexOf('@')=="-1")

	{

	alert("Please enter your Your Email properly!")

	window.document.FormWanted.email.focus();

	return false;

	}

	else{

    document.FormWanted.action="wanted.php";

    document.FormWanted.submit();

    }



}

//-----------------------------------------------------------------------------

// buying 

//-----------------------------------------------------------------------------

function buy()

{

	if(document.FormBuy.machinedesc.value==''){

    document.FormBuy.machinedesc.focus();

    alert("Please make sure Machine Description is not left blank");

   	return false;

    }

	if(document.FormBuy.features.value==''){

    document.FormBuy.features.focus();

    alert("Please make sure Features is not left blank");

   	return false;

    }

	if(document.FormBuy.cpersontxt.value==''){

    document.FormBuy.cpersontxt.focus();

    alert("Please make sure Contact Person is not left blank");

   	return false;

    }

	if (window.document.FormBuy.mailtxt.value.indexOf('.')=="-1" || window.document.FormBuy.mailtxt.value.indexOf('@')=="-1")

	{

	alert("Please enter your Your Email properly!")

	window.document.FormBuy.mailtxt.focus();

	return false;

	}

	else{

    document.FormBuy.action="buying.php";

    document.FormBuy.submit();

    }



}

//-----------------------------------------------------------------------------

// Sellin 

//-----------------------------------------------------------------------------

function sell()

{

	if(document.FormSell.machinedesc.value==''){

    document.FormSell.machinedesc.focus();

    alert("Please make sure Machine Description is not left blank");

   	return false;

    }

	if(document.FormSell.features.value==''){

    document.FormSell.features.focus();

    alert("Please make sure Features is not left blank");

   	return false;

    }

	if(document.FormSell.cpersontxt.value==''){

    document.FormSell.cpersontxt.focus();

    alert("Please make sure Contact Person is not left blank");

   	return false;

    }

	if (window.document.FormSell.mailtxt.value.indexOf('.')=="-1" || window.document.FormSell.mailtxt.value.indexOf('@')=="-1")

	{

	alert("Please enter your Your Email properly!")

	window.document.FormSell.mailtxt.focus();

	return false;

	}

	else{

    document.FormSell.action="selling.php";

    document.FormSell.submit();

    }



}



function CheckLogin() {



			if(document.lform.us.value=="")

			{

				window.alert('Enter your username, please!');

				document.lform.us.focus();

				return false;

			}



			if(document.lform.ps.value=="")

			{

				window.alert('Enter your password, please!');

				document.lform.ps.focus();

				return false;

			}



		}





function CheckRegister() {



			if(document.RegForm.NewUsername.value=="")

			{

				window.alert('Enter your username, please!');

				document.RegForm.NewUsername.focus();

				return false;

			}



			if(document.RegForm.p1.value=="")

			{

				window.alert('Enter your password, please!');

				document.RegForm.p1.focus();

				return false;

			}



			if(document.RegForm.p2.value=="")

			{

				window.alert('Confirm your password, please!');

				document.RegForm.p2.focus();

				return false;

			}



			if(document.RegForm.p1.value != "" && document.RegForm.p2.value != "" && document.RegForm.p1.value != document.RegForm.p2.value)

			{

				window.alert('Enter and confirm your password again!');

				document.RegForm.p1.value="";

				document.RegForm.p2.value="";

				document.RegForm.p1.focus();

				return false;

			}



			if(document.RegForm.email.value=="")

			{

				window.alert('Enter your Email, please!');

				document.RegForm.email.focus();

				return false;

			}

			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.RegForm.email.value))

			{

				

			}

			else

			{

			alert("Invalid E-mail Address! Please re-enter.");

			document.RegForm.email.focus();

			return false;

			}

			



			if(document.RegForm.FirstName.value=="")

			{

				window.alert('Enter your First Name, please!');

				document.RegForm.FirstName.focus();

				return false;

			}



			if(document.RegForm.LastName.value=="")

			{

				window.alert('Enter your Last Name, please!');

				document.RegForm.LastName.focus();

				return false;

			}



			if(document.RegForm.Phone.value=="")

			{

				window.alert('Enter your Phone, please!');

				document.RegForm.Phone.focus();

				return false;

			}



			



		}



		function CheckNewsletter() {



			

			if(document.RegForm.FirstName.value=="")

			{

				window.alert('Enter your First Name, please!');

				document.RegForm.FirstName.focus();

				return false;

			}



			if(document.RegForm.LastName.value=="")

			{

				window.alert('Enter your Last Name, please!');

				document.RegForm.LastName.focus();

				return false;

			}



			

			if(document.RegForm.email.value=="")

			{

				window.alert('Enter your Email, please!');

				document.RegForm.email.focus();

				return false;

			}

			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.RegForm.email.value))

			{

				

			}

			else

			{

			alert("Invalid E-mail Address! Please re-enter.");

			document.RegForm.email.focus();

			return false;

			}

			



			if(document.RegForm.company.value=="")

			{

				window.alert('Enter your Company, please!');

				document.RegForm.company.focus();

				return false;

			}



			if(document.RegForm.City.value=="")

			{

				window.alert('Enter your City, please!');

				document.RegForm.City.focus();

				return false;

			}



			if(document.RegForm.State.value=="")

			{

				window.alert('Enter your State, please!');

				document.RegForm.State.focus();

				return false;

			}

			

			if(document.RegForm.Country.value=="")

			{

				window.alert('Enter your Country, please!');

				document.RegForm.Country.focus();

				return false;

			}



			if(document.RegForm.Phone.value=="")

			{

				window.alert('Enter your Phone, please!');

				document.RegForm.Phone.focus();

				return false;

			}



			document.RegForm.action="/newsletter_confirm.php";

			document.RegForm.submit();



		}



function CheckEmailPopup()

{

			if(document.RegForm.toemail.value=="")

			{

				window.alert('Enter Email, please!');

				document.RegForm.toemail.focus();

				return false;

			}

			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.RegForm.toemail.value))

			{

				

			}

			else

			{

			alert("Invalid E-mail Address! Please re-enter.");

			document.RegForm.toemail.focus();

			return false;

			}





			if(document.RegForm.Name.value=="")

			{

				window.alert('Enter your name, please!');

				document.RegForm.Name.focus();

				return false;

			}

			if(document.RegForm.email.value=="")

			{

				window.alert('Enter your Email, please!');

				document.RegForm.email.focus();

				return false;

			}

			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.RegForm.email.value))

			{

				

			}

			else

			{

			alert("Invalid E-mail Address! Please re-enter.");

			document.RegForm.email.focus();

			return false;

			}



}

//** Set font size- © anil@futuristiceSolutions.com



var min=8;

var max=20;

function increaseFontSize() {

   var p = document.getElementsByTagName('p');

   for(i=0;i<p.length;i++) {

      if(p[i].style.fontSize) {

         var s = parseInt(p[i].style.fontSize.replace("px",""));

      } else {

         var s = 12;

      }

      if(s!=max) {

         s += 1;

      }

      p[i].style.fontSize = s+"px"

   }

}

function decreaseFontSize() {

   var p = document.getElementsByTagName('p');

   for(i=0;i<p.length;i++) {

      if(p[i].style.fontSize) {

         var s = parseInt(p[i].style.fontSize.replace("px",""));

      } else {

         var s = 12;

      }

      if(s!=min) {

         s -= 1;

      }

      p[i].style.fontSize = s+"px"

   }   

}

<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

//-->










