//functions declarations


function scbg(objRef, state) {
	objRef.style.backgroundColor = (1 == state) ? '#EEEEEE' : '#FFFFFF';
	return;
}

function scbg2(objRef, state, bgcolor) {
	objRef.style.backgroundColor = (1 == state) ? '#EEEEEE' : bgcolor;
	return;
}


function getBlank (form, stdValue){
	if (form.value == stdValue){
		form.value = '';
	}
	return true;
}

function header(){	
	var icon_dir = getIconPath()
	var image_dir = getImagePath()
	var html_dir = getHtmlPath()
	var root_path = getRootPath()
	
	
	document.writeln(
	'<table cellpadding="0" cellspacing="0"> \n'+
	'<tr> \n'+
	'	<td class="logo"><a href="'+html_dir+'../index.html"><img src="'+image_dir+'nicpsulogo.jpg" alt="NIC Punjab State Centre" width="257" height="26" /></a></td> \n'+
	'	<td class="tabs" colspan="2"><a href="'+html_dir+'services.htm"><img src="'+image_dir+'services.jpg" alt="Services" width="144" height="30" /></a><a href="'+html_dir+'products.htm"><img src="'+image_dir+'products.jpg" alt="Products" width="131" height="30"/></a><!--<a href="javascript:pop_nic(\'http://qms.chd.nic.in\')"><img src="'+image_dir+'employees.jpg" alt="Employee\'s" width="132" height="30"/></a>--></td> \n'+
	'</tr> \n'+
	'<tr> \n'+
	'	<td class="col1" rowspan="2"><img src="'+image_dir+'image1.jpg" alt="" width="308" height="147" /></td> \n'+
	'	<td class="col2" rowspan="2"><img src="'+image_dir+'image2.jpg" alt="" width="89" height="147" /></td> \n'+
	'	<td class="col3"><img src="'+image_dir+'image3.jpg" width="383" alt="" height="120" /></td> \n'+
	'</tr> \n'+
	'<tr> \n'+
	'	<td class="row3"> \n'+
	'		<div class="search"> \n'+
	'		<form action="http://www.google.com/custom" method="get"> \n'+
	'			<input type="text"   name="q" id="query" onfocus="getBlank (this, \'Search the site with google:\');" value="Search the site with google:" size="25" />&nbsp; \n'+
	'			<input type="hidden" name="sitesearch" value="pbsc.nic.in" /> \n'+
	'			<input type="hidden" name="domains" value="pbsc.nic.in" /> \n'+
	'			<input type="hidden" name="cof" value="S:http://pbsc.nic.in;AH:left;LH:26;L:http://www.pbsc.nic.in/images/nicpsulogo.jpg;LW:257;AWFID:983c212dd2b5fee3;" /> \n'+
	'			<input type="image"  name="sa" value="Google Search" src="'+image_dir+'search.gif" alt="Search" /> \n'+
	'		</form> \n'+
	'		</div> \n'+
	'	</td> \n'+
	'</tr> \n'+
	'</table>'
	)
}

function topstrip(){
	var html_dir = getHtmlPath()
	var home_link = ""
	if (position > 0){
		home_link = '<a href="'+html_dir+'../index.html">Home</a>'
	}
	document.writeln(
	'<div class="menu"> \n'+
	'<table cellpadding="0" cellspacing="0"> \n'+
	'<tr> \n'+
	'	<td class="col1">'+home_link+'</td> \n'+
	'	<td class="col2">Welcome to Official website of Punjab State Centre!</td> \n'+
	'</tr> \n'+
	'</table> \n'+
	'</div>'
	)
}

function footer(){	
	var icon_dir = getIconPath()
	var image_dir = getImagePath()	
	var html_dir = getHtmlPath()		
	
	document.writeln('<hr /> \n')
	
	copyright() 
	
	var menu_link = ""
	if (position > 0){
		menu_link = '<div class="menu"> \n'+
					'<table border="0" cellpadding="0" cellspacing="0" width="500"> \n'+
					'<tr valign="top"> \n'+
					'	<td> \n'+
					'		<a href="'+html_dir+'../index.html">Home</a> \n'+
					'		<span class="menu-separator">||</span> \n'+
					'		<a href="'+html_dir+'contact_us.htm">Contact Us</a> \n'+
					'		<span class="menu-separator">||</span> \n'+
					'		<a href="mailto:sio-punjab@nic.in">Send your Feedback</a> \n'+
					'	</td> \n'+
					'</tr> \n'+
					'</table> \n'+
					'</div> \n'
	}
	
	document.writeln(
	menu_link+
	'<div class="resolution">This site is best viewed in 800x600 resolutions. Use IE 4.5/Netscape 4.5 or above.</div> '
	)
	
}

function copyright(){		
	var html_dir = getHtmlPath()
	document.writeln(
	'<div id="copyright"> \n'+
	'	<a href="javascript:void(0)" onclick="pop_nic(\''+html_dir+'copyright.htm\')">Copyright</a><br/> \n'+
	'	<a href="javascript:void(0)" onclick="pop_nic(\''+html_dir+'disclaimer.htm\')">Disclaimer</a><br/> \n'+
	'	<a href="javascript:void(0)" onclick="pop_nic(\''+html_dir+'privacy_statement.htm\')">Privacy Statement</a> \n'+
	'</div> \n'
	)
}


function menu(){
	var url = document.location.href
	var index = url.lastIndexOf("/")
	var filename = url.substring(index+1, url.length)
	index = filename.lastIndexOf("#")
	var filename2 = filename
	if (index > -1) filename2 = filename.substring(0, index)
	
	for (var i = 0; i < menu_heads.length; i++){
		if(menu_heads[i][0] == menu_id){
			document.writeln('<div class="menupage-group">')
		}else{
			document.writeln('<div class="menu-group">')
		}
		document.writeln('<div class="menu-title">'+menu_heads[i][1]+'</div>')
		
		for (var j = 0; j < menu_subheads.length; j++){			
			if (menu_heads[i][0] == menu_subheads[j][0]){					
				if (menu_subheads[j][1] == menuitem_id && menu_heads[i][0] == menu_id){
					document.writeln('<div class="menupageitem-group">')
					document.writeln('	<div class="menupageitem-title">'+menu_subheads[j][2]+'</div>')	
					var index = toc_location.indexOf("menu")
					if (index > -1){							
						for (var k = 0; k < menu_items.length; k++){
							document.writeln('<div class="menupageitem">')
							if(menu_items[k][1].charAt(0) == "#"){
								document.writeln('			<a href="'+filename2+menu_items[k][1]+'">'+menu_items[k][0]+'</a>')
							}else{
								document.writeln('			<a href="'+menu_items[k][1]+'">'+menu_items[k][0]+'</a>')
							}							
							document.writeln('</div>')
						}
					}		
					document.writeln('</div>')	
				}else{
					document.writeln('<div class="menuitem">')
					document.writeln('	<a href="'+menu_subheads[j][3]+'">'+menu_subheads[j][2]+'</a>')
					document.writeln('</div>')	
				}
			}
		}
		document.writeln('</div>')
	}
	w3cValidator()
}

function minitoc(){
	var index = toc_location.indexOf("page")
	if (index > -1 && menu_items.length > 0){
		document.writeln('<div id="minitoc-area">')
		document.writeln('<table cellspacing="0">')
		document.writeln('<tr>')
		document.writeln('	<td>')
		document.writeln('		<ul class="minitoc">')
		for (var i = 0; i < menu_items.length; i++){
			document.writeln('			<li><a href="'+menu_items[i][1]+'">'+menu_items[i][0]+'</a></li>')
		}
		document.writeln('		</ul>')
		document.writeln('	</td>')
		document.writeln('</tr>')
		document.writeln('</table>')
		document.writeln('</div>')
	}
}
	

function w3cValidator(){
	document.writeln('<div class="w3cValidator">')
	document.writeln('<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" title="Valid XHTML 1.0!" height="31" width="88" /></a>')
	document.writeln('</div>')
	document.writeln('<div class="w3cValidator">')
	document.writeln('<a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" title="Valid CSS!" /></a>')
	document.writeln('</div>')
}



var html_dir = getHtmlPath()
var pdf_dir = getPdfPath()



function pop_other(requrl){
	mywin=window.open(html_dir+"popup.htm","pop_other","width=600,height=350,screenX=100,screenY=0,scrollbars=yes,menubar=yes,resizable=yes,status=yes,toolbar=yes,directories=no,location=yes");
	setTimeout("mywin.location.href='"+requrl+"';mywin.focus();",2000);
	mywin.focus();
}

function pop_nic(url){
	mywin=window.open("","pop_nic","width=560,height=350,screenX=125,screenY=100,scrollbars=no,menubar=no,resizable=yes,status=no,toolbar=no,directories=no,location=no");
	mywin.location.href=url;
	mywin.focus();
}

var menu_heads = new Array(
	new Array("about", "About Us", html_dir+"profile.htm"),
	//new Array("online", "Online Applications", html_dir+"profile.htm"),
	new Array("services", "Services", html_dir+"glance.htm"),
	new Array("forms_procedures", "Forms &amp; Procedures", html_dir+"forms_procedures.htm"),
	new Array("contacts", "Contact Information", html_dir+"contact_us.htm")
)

var menu_subheads = new Array(
	new Array("about", "profile", "A Profile", html_dir+"profile.htm"),
	new Array("about", "orgchart", "Organisation Chart", "javascript:pop_nic('"+pdf_dir+"organisation_chart.pdf')"),
	new Array("about", "punjab_units", "NIC Punjab State Centre Units", html_dir+"punjab_units.htm"),
	new Array("about", "achievements", "Major Achievements", html_dir+"achievements.htm"),
//	new Array("about", "projects", "Projects", html_dir+"projects.htm"),
//	new Array("about", "infrastructure", "Infrastructure", html_dir+"infrastructure.htm"),
	new Array("online", "mpr", "Monthly Progress Report", html_dir+"under_construction.htm"),
	new Array("online", "prs", "Project Reporting System", html_dir+"under_construction.htm"),
	new Array("online", "mpr", "Project Management", html_dir+"under_construction.htm"),		
	new Array("services", "consultancy", "Technical Consultancy", html_dir+"services_consultancy.htm"),				
	new Array("services", "website_development", "Website Development", html_dir+"services_website_development.htm"),	
	new Array("services", "software_development", "Software Development", html_dir+"services_software_development.htm"),				
//	new Array("services", "internet_services", "Internet Services", html_dir+"services_internet_services.htm"),		
	new Array("services", "networking", "Networking", html_dir+"services_networking.htm"),			
	new Array("services", "video_conferencing", "Video Conferencing", html_dir+"services_video_conferencing.htm"),	
	new Array("services", "office_automation", "Office Automation", html_dir+"services_office_automation.htm"),
	new Array("services", "training", "Training", html_dir+"services_training.htm"),				
//	new Array("services", "multi_media", "Multi-Media", html_dir+"services_multi_media.htm"),	
	new Array("forms_procedures", "web", "Web Services", html_dir+"forms_procedures_web.htm"),
	new Array("forms_procedures", "tenders", "Tenders Uploading", html_dir+"forms_procedures_tenders.htm"),
	new Array("forms_procedures", "policies", "Policies Uploading", html_dir+"forms_procedures_policies.htm"),
	new Array("contacts", "contact_us", "Contact Us", html_dir+"contact_us.htm"),
	new Array("contacts", "telephone_directory", "Telephone Directory", html_dir+"telephone_directory.htm"),
	new Array("contacts", "feedback", "Your Feedback", html_dir+"feedback.htm")
)
