var baseURL = 'http://www.planetdesign.in/pdcontactbar/'; //ONline path
document.write("<script type='text/javascript' src='"+baseURL+"pd_FormValidation.js'></script>");
var img_path = baseURL+"images/";

document.write("<style>.pd_errMessage{color:red;} a.toplink:active {font-family: Verdana, Arial, Helvetica, sans-serif;font-weight:bold;font-size: 11px;color: #666666;text-decoration: none;}");
document.write("a.toplink:link {font-family: Verdana, Arial, Helvetica, sans-serif;font-weight:normal;font-size: 11px;color: #666666;text-decoration: none;}");
document.write("a.toplink:visited {font-family: Verdana, Arial, Helvetica, sans-serif;font-weight:bold;font-size: 11px;color: #666666;text-decoration: none;}");
document.write("a.toplink:hover {font-family: Verdana, Arial, Helvetica, sans-serif;font-weight:bold;font-size: 11px;color: #666666;text-decoration:none;}");
document.write(".style2 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FF9900; }");
document.write(".text{font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;font-style: normal;line-height: 18px;color: #666666;text-decoration: none;}");
document.write(".blueheading, .blueheading a, .blueheading a:hover  {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 11px; color: #316FA0; text-decoration:none;}");
document.write(".small_text {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;font-style: normal;	color: #666666;text-decoration: none;}");
document.write(".div_border{border-bottom:5px solid orange; border-top: 1px solid orange; border-left: 1px solid orange; border-right: 1px solid orange; }");
document.write("</style>");

document.write("<table width=100%  border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=top>");
document.write("<table width=100% align=center>");
document.write("<tr><td height=37 align='center' background='"+img_path+"table_bg1.gif' style='background-repeat: repeat-x;  background-position:center;'>");

document.write("<table width=980  border=0 cellspacing=0 cellpadding=0>");
document.write("<tr><td width=220 align=left valign=middle><a href='#' class='toplink' id='searchlink1' rel='subcontent1'><img src='"+ img_path +"top1.jpg' border='0' width='16' height='18' align='absmiddle'><b>Toll Free 1800-102-4994</b></a></td>");
//document.write("<td width=93 align=center valign=middle><a href='#' id='searchlink2' rel='subcontent2' class='toplink'><img src='"+ img_path +"top2.jpg' width='16' height='18' border='0' align='absmiddle'>Live Chat</a></td>");
document.write("<td width=172 align=center valign=middle><a href='#' id='searchlink3' rel='subcontent3' class='toplink'><img src='"+ img_path +"top3.jpg' width='16' height='18' border='0' align='absmiddle'>Request Call Back</a></td>");
document.write("<td width=130 align=center valign=middle><a href='#' id='searchlink5' rel='subcontent5' class='toplink'><img src='"+ img_path +"top5.jpg' width='16' height='18' border='0' align='absmiddle'>Bookmark Us</a></a></td>");
document.write("<td width=132 align=center valign=middle><a href='pdlogin.asp' class='toplink'><img src='"+ img_path + "top6.jpg' width='16' height='18' border='0' align='absmiddle'>Client Login</a></td>");
document.write("<td width=100 align=center valign=middle><a href='#' id='searchlink7' rel='subcontent7' class='toplink'><img src='"+ img_path +"top7.jpg' width='16' height='18' border='0' align='absmiddle'>pd Sites</a></td>");
document.write("<td width=170 align=center valign=middle><a href='#' id='connectlink' rel='connect' class='toplink'><img src='"+ img_path +"connect.png' width='16' height='18' border='0' align='absmiddle'>Connect with us</a></td>");
document.write("<td width=74 align=center valign=middle><img src='"+ img_path +"icon_09.jpg' width=40 height=35 border=0></td></tr></table> </td></tr></table>");

document.write("<div id='subcontent3' style='position:absolute; visibility: hidden; background-color: white; width: 250px; padding: 8px;' class='div_border'>");
document.write("<table width='100%' cellpadding='0' align='center'>");
document.write("<tr><td align='left' class='blueheading'>Request call back</td></tr>"); 
document.write("<tr><td align='left' class='small_text' style='text-align:justify;'>Please give your contact number and convenient time and our executives will get in touch with you.</td></tr>");
document.write("<tr><td align='left'><form id='frmCallback' name='frmCallback'  method='post' action='"+baseURL+"sendrequestcallback.asp' onSubmit=\"return chkValidation('frmCallback');\">");
document.write("<table width='100%'  border='0' cellspacing='0' cellpadding='3' class='small_text'><tr>");
document.write("<td>Name<br><input type='text' id=rcb_name name=rcb_name class='small_text pd_required pd_evechange pd_alpha_space pd_name:Name'></td></tr><tr><td>Email<br><input type='text' id=rcb_email name=rcb_email class='small_text pd_required pd_evechange pd_email pd_name:Email'></td>");
document.write("</tr><tr><td>Phone(With country code)<br><input type='text' id=rcb_phone name=rcb_phone class='small_text pd_required pd_evechange pd_telephone pd_name:Phone'></td></tr>");
document.write("<tr><td> Convenient Time <br><input type='text' id=rcb_time name=rcb_time class='small_text'></td></tr><tr><td>Message<br><textarea id=rcb_comments name=rcb_comments cols='30' rows='3' class='small_text'></textarea></td>");
document.write("</tr><tr><td align='left'><input type='submit' name='Submit' value='Submit' class='small_text'></td></tr></table></form></td></tr></table>");
document.write("</div>");

document.write("<div id='subcontent7' style='position:absolute; visibility: hidden;background-color: white;  white; width: 250px;  padding: 8px;'  class='div_border'>");
document.write("<table width='100%' cellpadding='0' align='center'><tr><td align='left' class='blueheading'>Logo Brand Design, Stationery Design and related services.</td></tr>");
document.write("<tr><td align='left' class='text'><a href='http://www.pdlogo.com' target='_blank'>www.pdlogo.com</a><br/><br/></td>");
document.write("</tr><tr><td align='left' class='blueheading'>Website Design and web related services.</td></tr>");
document.write("<tr><td align='left' class='text'><a href='http://www.pdwebsite.com' target='_blank'>www.pdwebsite.com</a><br/><br/></td></tr>");
document.write("<tr><td align='left' class='blueheading'>Design and Web Services for Startups and new Businesses.</td></tr>");
document.write("<tr><td align='left' class='text'><a href='http://www.pdstartup.com' target='_blank'>www.pdstartup.com</a><br/><br/></td></tr>");
document.write("<tr><td align='left' class='blueheading'>Brochure, Collaterals,  and other Print Design. </td></tr>");
document.write("<tr><td align='left' class='text'><a href='http://www.pdcmyk.com' target='_blank'>www.pdcmyk.com</a><br/><br/></td></tr>");
document.write("<tr><td align='left' class='blueheading'>Our corporate website. </td></tr>");
document.write("<tr><td align='left' class='text'><a href='http://www.planetdesign.in' target='_blank'>www.planetdesign.in</a><br/><br/></td></tr></table>");
document.write("</div>");

document.write("<div id='connect' style='position:absolute; visibility: hidden;background-color: white;  white; width: 250px;  padding: 8px;'  class='div_border'>");
document.write("<table width='100%' cellpadding='0' align='center'><tr><td align='left' class='blueheading'><a href='http://twitter.com/pdcreatives' target='_blank'><img src='"+ img_path +"top4.png' width='16' height='18' border='0' align='absmiddle'> Follow us on Twitter</a><br/><br/></td></tr>");
document.write("<tr><td align='left' class='blueheading'><a href='http://www.facebook.com/pages/Planet-Design/285755558878?ref=ts' target='_blank'><img src='"+ img_path +"facebook.png' width='16' height='18' border='0' align='absmiddle'> Facebook</a><br/><br/></td></tr>");
document.write("<tr><td align='left' class='blueheading'><a href='http://pdcreatives.wordpress.com/' target='_blank'><img src='"+ img_path +"blog.png' width='16' height='18' border='0' align='absmiddle'> Our Blog.</a><br/><br/></td></tr>");
document.write("</table></div>");

document.write("<div id='subcontent2' style='position:absolute; visibility: hidden; background-color: white; width: 200px; padding: 8px;'  class='div_border'>");
document.write("<script language='JavaScript' type='text/javascript'>");
document.write("try{getscript('planetdesign_in',window.location,gethistory(),document.referrer);}catch(e){}</script></div>");
document.write("<div id='subcontent5' style='position:absolute; visibility: hidden; background-color: white; width: 200px; padding: 8px;' class='div_border'>");
document.write("<script type='text/javascript' src='http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;style=default&amp;publisher=f653db0b-fdea-4b6a-b407-b17fb0120bd1'></script>");
document.write("</div>");

fnSetValidation();
function fnSetValidation(){
	if(typeof(setValidation)=='function'){
		setValidation('frmCallback');setValidation('frmEnquiry');
	}
	else window.setTimeout("fnSetValidation();",1000);
}

fnSetShare();
function fnSetShare(){
	if(document.getElementById('sharethis_0')){
		document.getElementById('subcontent5').appendChild(document.getElementById('sharethis_0'));
	}
	else window.setTimeout("fnSetShare();",1000);
}

var dropdowncontent={ 
	disableanchorlink: true, //when user clicks on anchor link, should link itself be disabled (always true if "revealbehavior" above set to "click")
 hidedivmouseout: [true, 200], //Set hiding behavior within Drop Down DIV itself: [hide_div_onmouseover?, miliseconds_before_hiding]
	ajaxloadingmsg: "Loading content. Please wait...", //HTML to show while ajax page is being feched, if applicable
	ajaxbustcache: true, //Bust cache when fetching Ajax pages?

	getposOffset:function(what, offsettype){
		return (what.offsetParent)? what[offsettype]+this.getposOffset(what.offsetParent, offsettype) : what[offsettype]
	},

	isContained:function(m, e){
		var e=window.event || e
		var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
		while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
		if (c==m)
			return true
		else
			return false
	},

	show:function(anchorobj, subobj, e){
		if (!this.isContained(anchorobj, e)){
			var e=window.event || e
			if (e.type=="click" && subobj.style.visibility=="visible"){
				subobj.style.visibility="hidden"
				return
			}
			var horizontaloffset=(subobj.dropposition[0]=="left")? -(subobj.offsetWidth-anchorobj.offsetWidth) : 0 //calculate user added horizontal offset
			var verticaloffset=(subobj.dropposition[1]=="top")? -subobj.offsetHeight : anchorobj.offsetHeight //calculate user added vertical offset
			subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + horizontaloffset + "px"
			subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+verticaloffset+"px"
			subobj.style.clip=(subobj.dropposition[1]=="top")? "rect(auto auto auto 0)" : "rect(0 auto 0 0)" //hide drop down box initially via clipping
			subobj.style.visibility="visible"
			subobj.startTime=new Date().getTime()
			subobj.contentheight=parseInt(subobj.offsetHeight)
			if (typeof window["hidetimer_"+subobj.id]!="undefined") //clear timer that hides drop down box?
				clearTimeout(window["hidetimer_"+subobj.id])
			this.slideengine(subobj, (subobj.dropposition[1]=="top")? "up" : "down")
		}
	},

	curveincrement:function(percent){
		return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
	},

	slideengine:function(obj, direction){
		var elapsed=new Date().getTime()-obj.startTime //get time animation has run
		if (elapsed<obj.glidetime){ //if time run is less than specified length
			var distancepercent=(direction=="down")? this.curveincrement(elapsed/obj.glidetime) : 1-this.curveincrement(elapsed/obj.glidetime)
			var currentclip=(distancepercent*obj.contentheight)+"px"
			obj.style.clip=(direction=="down")? "rect(0 auto "+currentclip+" 0)" : "rect("+currentclip+" auto auto 0)"
			window["glidetimer_"+obj.id]=setTimeout(function(){dropdowncontent.slideengine(obj, direction)}, 10)
		}
		else{ //if animation finished
			obj.style.clip="rect(0 auto auto 0)"
		}
	},

	hide:function(activeobj, subobj, e){
		if (!dropdowncontent.isContained(activeobj, e)){
			window["hidetimer_"+subobj.id]=setTimeout(function(){
				subobj.style.visibility="hidden"
				subobj.style.left=subobj.style.top=0
				clearTimeout(window["glidetimer_"+subobj.id])
			}, dropdowncontent.hidedivmouseout[1])
		}
	},

	hidediv:function(subobjid){
		document.getElementById(subobjid).style.visibility="hidden"
	},

	ajaxconnect:function(pageurl, divId){
		var page_request = false
		var bustcacheparameter=""
		if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
			page_request = new XMLHttpRequest()
		else if (window.ActiveXObject){ // if IE6 or below
			try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e){
				try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		}
		else
			return false
		document.getElementById(divId).innerHTML=this.ajaxloadingmsg //Display "fetching page message"
		page_request.onreadystatechange=function(){dropdowncontent.loadpage(page_request, divId)}
		if (this.ajaxbustcache) //if bust caching of external page
			bustcacheparameter=(pageurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
		page_request.open('GET', pageurl+bustcacheparameter, true)
		page_request.send(null)
	},

	loadpage:function(page_request, divId){
		if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
			document.getElementById(divId).innerHTML=page_request.responseText
		}
	},

 init:function(anchorid, pos, glidetime, revealbehavior){
		var anchorobj=document.getElementById(anchorid)
		var subobj=document.getElementById(anchorobj.getAttribute("rel"))
		var subobjsource=anchorobj.getAttribute("rev")
		if (subobjsource!=null && subobjsource!="")
			this.ajaxconnect(subobjsource, anchorobj.getAttribute("rel"))
		subobj.dropposition=pos.split("-")
		subobj.glidetime=glidetime || 1000
		subobj.style.left=subobj.style.top=0
		if (typeof revealbehavior=="undefined" || revealbehavior=="mouseover"){
			anchorobj.onmouseover=function(e){dropdowncontent.show(this, subobj, e)}
			anchorobj.onmouseout=function(e){dropdowncontent.hide(subobj, subobj, e)}
			if (this.disableanchorlink) anchorobj.onclick=function(){return false}
		}
		else
			anchorobj.onclick=function(e){dropdowncontent.show(this, subobj, e); return false}
		if (this.hidedivmouseout[0]==true) //hide drop down DIV when mouse rolls out of it?
			subobj.onmouseout=function(e){dropdowncontent.hide(this, subobj, e)}
	}
}
setTimeout('fnLoadDiv()',1500);
function fnLoadDiv()
{

//dropdowncontent.init("searchlink1", "right-bottom", 500, "mouseover")
dropdowncontent.init("searchlink2", "right-bottom", 500, "mouseover")
dropdowncontent.init("searchlink3", "right-bottom", 500, "mouseover")
//dropdowncontent.init("searchlink4", "right-bottom", 500, "mouseover")
dropdowncontent.init("searchlink5", "right-bottom", 500, "mouseover")
//dropdowncontent.init("searchlink6", "right-bottom", 500, "click")
dropdowncontent.init("searchlink7", "right-bottom", 500, "mouseover")
//dropdowncontent.init("contentlink", "left-top", 300, "click")
dropdowncontent.init("connectlink", "right-bottom", 500, "mouseover")

}

this.document.close();
//Call dropdowncontent.init("anchorID", "positionString", glideduration, "revealBehavior") at the end of the page:
