function toggle(div_blanket,div_menu_blocker) 
{
	var el_blanket = document.getElementById(div_blanket);
	var el_blocker = document.getElementById(div_menu_blocker);
	
	if ( el_blanket.style.display == 'none' ) 
	{	
		el_blanket.style.display = 'block';
		el_blocker.style.display = 'block';
	}
	else 
	{
		el_blanket.style.display = 'none';
		el_blocker.style.display = 'none';			
	}
}
//----------------for login-----------------------------------------------//
function blanket_size(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportheight = window.innerHeight;
	} else {
		viewportheight = document.documentElement.clientHeight;
	}
	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
		blanket_height = viewportheight;
	} else {
		if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
			blanket_height = document.body.parentNode.clientHeight;
		} else {
			blanket_height = document.body.parentNode.scrollHeight;
		}
	}
	var blanket = document.getElementById('blanket');
	blanket.style.height = '515' + 'px';
	var popUpDiv = document.getElementById(popUpDivVar);
	//popUpDiv_height=blanket_height/2-216;
	popUpDiv_height=-890;//150 is half popup's height
	popUpDiv.style.position = 'relative';
	popUpDiv.style.top = popUpDiv_height + 'px';
}

function window_pos(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerHeight;
	} else {
		viewportwidth = document.documentElement.clientHeight;
	}
	if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
		window_width = viewportwidth;
	} else {
		if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
			window_width = document.body.parentNode.clientWidth;
		} else {
			window_width = document.body.parentNode.scrollWidth;
		}
	}
	var popUpDiv = document.getElementById(popUpDivVar);
	//window_width=window_width/2-100;
	window_width =430;
	popUpDiv.style.position = 'relative';
	popUpDiv.style.left = window_width + 'px';
}
function popup_for_login(windowname) {
	blanket_size(windowname);
	window_pos(windowname);
	toggle('blanket','menu_blocker');
	toggle(windowname);		
}
//----------------for sitemap-----------------------------------------------//
function blanket_size_for_sitemap(popUpDivVar) {
  if (typeof window.innerWidth != 'undefined') {
    viewportheight = window.innerHeight;
  } else {
    viewportheight = document.documentElement.clientHeight;
  }
  if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
    blanket_height = viewportheight;
  } else {
    if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
      blanket_height = document.body.parentNode.clientHeight;
    } else {
      blanket_height = document.body.parentNode.scrollHeight;
    }
  }
  var blanket = document.getElementById('blanket');
  blanket.style.height = '515' + 'px';
  var popUpDiv = document.getElementById(popUpDivVar);
  //popUpDiv_height=blanket_height-1826;//150 is half popup's height
  popUpDiv_height=-1000;//150 is half popup's height
  popUpDiv.style.position = 'relative';
  popUpDiv.style.top = popUpDiv_height + 'px';
}

function window_pos_for_sitemap(popUpDivVar) {
  if (typeof window.innerWidth != 'undefined') {
    viewportwidth = window.innerHeight;
  } else {
    viewportwidth = document.documentElement.clientHeight;
  }
  if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
    window_width = viewportwidth;
  } else {
    if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
      window_width = document.body.parentNode.clientWidth;
    } else {
      window_width = document.body.parentNode.scrollWidth;
    }
  }
  var popUpDiv = document.getElementById(popUpDivVar);
//  window_width = window_width/2 - 600;//150 is half popup's width
  window_width = 100;//150 is half popup's width
  popUpDiv.style.position = 'relative';
  popUpDiv.style.left = window_width + 'px';
}

function popup_for_sitemap(windowname) {
  blanket_size_for_sitemap(windowname);
  window_pos_for_sitemap(windowname);
  toggle('blanket','menu_blocker');
  toggle(windowname);   
}

//----------------for About This Website--------------------------------------//
function blanket_size_for_About_This_Website(popUpDivVar) {
  if (typeof window.innerWidth != 'undefined') {
    viewportheight = window.innerHeight;
  } else {
    viewportheight = document.documentElement.clientHeight;
  }
  if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
    blanket_height = viewportheight;
  } else {
    if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
      blanket_height = document.body.parentNode.clientHeight;
    } else {
      blanket_height = document.body.parentNode.scrollHeight;
    }
  }
  var blanket = document.getElementById('blanket');
  blanket.style.height = '515' + 'px';
  var popUpDiv = document.getElementById(popUpDivVar);
  //popUpDiv_height=blanket_height-1826;//150 is half popup's height
  popUpDiv_height=-990;//150 is half popup's height
  popUpDiv.style.position = 'relative';
  popUpDiv.style.top = popUpDiv_height + 'px';
}

function window_pos_for_About_This_Website(popUpDivVar) {
  if (typeof window.innerWidth != 'undefined') {
    viewportwidth = window.innerHeight;
  } else {
    viewportwidth = document.documentElement.clientHeight;
  }
  if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
    window_width = viewportwidth;
  } else {
    if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
      window_width = document.body.parentNode.clientWidth;
    } else {
      window_width = document.body.parentNode.scrollWidth;
    }
  }
  var popUpDiv = document.getElementById(popUpDivVar);
//  window_width = window_width/2 - 600;//150 is half popup's width
  window_width = 145;//150 is half popup's width
  popUpDiv.style.position = 'relative';
  popUpDiv.style.left = window_width + 'px';
}

function popup_for_About_This_Website(windowname) {
  blanket_size_for_About_This_Website(windowname);
  window_pos_for_About_This_Website(windowname);
  toggle('blanket','menu_blocker');
  toggle(windowname);   
}

//----------------contact us-----------------------------------------------//
function blanket_size_for_contact_us(popUpDivVar) {
  if (typeof window.innerWidth != 'undefined') {
    viewportheight = window.innerHeight;
  } else {
    viewportheight = document.documentElement.clientHeight;
  }
  if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
    blanket_height = viewportheight;
  } else {
    if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
      blanket_height = document.body.parentNode.clientHeight;
    } else {
      blanket_height = document.body.parentNode.scrollHeight;
    }
  }
  var blanket = document.getElementById('blanket');
  blanket.style.height = '515' + 'px';
  var popUpDiv = document.getElementById(popUpDivVar);
  //popUpDiv_height=blanket_height-716;//150 is half popup's height
  popUpDiv_height=-963;//150 is half popup's height
  popUpDiv.style.position = 'relative';
  popUpDiv.style.top = popUpDiv_height + 'px';
}

function window_pos_for_contact_us(popUpDivVar) {
  if (typeof window.innerWidth != 'undefined') {
    viewportwidth = window.innerHeight;
  } else {
    viewportwidth = document.documentElement.clientHeight;
  }
  if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
    window_width = viewportwidth;
  } else {
    if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
      window_width = document.body.parentNode.clientWidth;
    } else {
      window_width = document.body.parentNode.scrollWidth;
    }
  }
  var popUpDiv = document.getElementById(popUpDivVar);
  //window_width = window_width/2 - 431;//150 is half popup's width
  window_width = 80;
  popUpDiv.style.position = 'relative';
  popUpDiv.style.left = window_width + 'px';
}

function popup_for_contact_us(windowname) {
  blanket_size_for_contact_us(windowname);
  window_pos_for_contact_us(windowname);
  toggle('blanket','menu_blocker');
  toggle(windowname);   

}
