/*
(function ()
{
	
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl.": "http://www.");
	
	var script = document.createElement("script");
	script.setAttribute("src",gaJsHost +"google-analytics.com/ga.js");
	script.setAttribute("type","text/javascript"); 
	
	var head = document.lastChild.firstChild;
	head.appendChild(script);
		
})();

function mechsoft_trakcer()
{
	var pageTracker = _gat._getTracker("UA-4961951-1");
	pageTracker._trackPageview();
	
}
*/

function mfilesflash()
{
 // Construct a correct page and its parameters.
  var szPage = "http://www.mechsoft.com.tr/Download/Mfiles/Overview/intro.swf";

 // Open a new window. (802 x 603)
 var winFlash = window.open( szPage, "winflash", "toolbar=no, width=800, height=600, resizable=no, menubar=no, scrollbars=yes, status=yes, directories=no, copyhistory=no, dependent=no");
 winFlash.focus();
}

function clickLiKurumsal(){
	elementDisplay("ulKurumsal",true);
	elementDisplay("ulHizmetler",false);
	elementDisplay("ulUrunler",false);
}

function clickLiHizmetler(){
	elementDisplay("ulKurumsal",false);
	elementDisplay("ulHizmetler",true);
	elementDisplay("ulUrunler",false);
	clickLiOutUrunler();
}

function clickLiUrunler(){
	elementDisplay("ulKurumsal",false);
	elementDisplay("ulHizmetler",false);
	elementDisplay("ulUrunler",true);
	
}

function clickLiOutUrunler()
{
	var s = document.getElementById("software");

	if(s){
		if(s.style.display == 'block')
			s.style.display = 'none';
	}
		
	s = document.getElementById("hardware");
	if(s){
		if(s.style.display == 'block')
			s.style.display = 'none';
	}
		
	
}

function clickLiIletisim(){
	elementDisplay("ulKurumsal",false);
	elementDisplay("ulHizmetler",false);
	elementDisplay("ulUrunler",false);
	clickLiOutUrunler();
}


function elementDisplay(element,type){
	var v = document.getElementById(element);
	if(v){
		if(type){
			v.style.display='block';
		}else{
			v.style.display='none';
		}
	}
}

function gotoPage(id){
	var div = document.getElementById('id');
	div.style.cursor='hand';
}

function init(){
	var logo = document.getElementById('logo');
	var div = document.createElement('div');
	var a = document.createElement('a');
	var span = document.createElement('span');

	div.style.cssText='position: absolute;left: 740px;top:155px; width: 210px;height: 25px;';
	a.target='_blank';
	a.href='http://www.mechsoft.com.tr';
	span.style.cssText='cursor:pointer;display:block;width: 210px;height:25px';

	
	if(logo){
		
		logo.style.cssText='position: absolute;left: 740px;top:155px; width: 210px;height: 25px;';
		
		a.appendChild(span);
		logo.appendChild(a);
		
	}else{
	
		var header = document.getElementById('header');
		
		a.appendChild(span);
		div.appendChild(a);		
		
		if(header)
		header.appendChild(div);
	}
}

function openInNew(href){
	var w = screen.width;
	var h = screen.height;
	window.open(href,'_blank','width=630,height=650,left=100,top=100,resizable=no,scrollbars=no,toolbar=no,status=no');
}


function onPageShow(id){
	onHidePages();
	$(id).show(); 
}

function onPageHizemtlerShow(id){
	onHideHizmetlerPages();
	$(id).show(); 
}

function onHideHizmetlerPages(){
	var s = $('productMainPage1');
	sHide(s);	 
	s = $('productMainPage2');
	sHide(s);
	s = $('productMainPage3');
	sHide(s);
	s = $('productMainPage4');
	sHide(s);
	s = $('productMainPage5');
	sHide(s);
	s = $('productMainPage6');
	sHide(s);	
	s = $('productMainPage7');
	sHide(s);	
	s = $('productMainPage8');
	sHide(s);	
}

function sHide(s){
	if(s)
	{
		s.hide();
	}
}

function onHidePages(){
	var s = $('productMainPage');
	sHide(s);
	s = $('productMainPage1');
	sHide(s); 
	s = $('productMainPage2');
	sHide(s);
	s = $('productMainPage3');
	sHide(s);
	s = $('productMainPage4');
	sHide(s);
	s = $('productMainPage5');
	sHide(s);
	s = $('productMainPage6');
	sHide(s);
	s = $('productMainPage7');
	sHide(s);
	s = $('productMainPage8');
	sHide(s);
	s = $('productMainPage9');
	sHide(s);
	s = $('productMainPage10');
	sHide(s);
	s = $('productMainPage11');
	sHide(s);
	s = $('productMainPage12');
	sHide(s);
} 

function getValue(varname)
{
  // First, we load the URL into a variable
  var url = window.location.href;

  // Next, split the url by the ?
  var qparts = url.split("?");

  // Check that there is a querystring, return "" if not
  if (qparts.length == 0)
  {
    return "";
  }

  // Then find the querystring, everything after the ?
  var query = qparts[1];

  // Split the query string into variables (separates by &s)
  var vars = query.split("&");

  // Initialize the value with "" as default
  var value = "";

  // Iterate through vars, checking each one for varname
  for (i=0;i<vars.length;i++)
  {
    // Split the variable by =, which splits name and value
    var parts = vars[i].split("=");
    
    // Check if the correct variable
    if (parts[0] == varname)
    {
      // Load value into variable
      value = parts[1];

      // End the loop
      break;
    }
  }
  
  // Convert escape code
  value = unescape(value);

  // Convert "+"s to " "s
  value.replace(/\+/g," ");

  // Return the value
  return value;
}

function onCalllink(){
	var s = getValue('page');
	if(s != null && s != ""){
		onPageHizemtlerShow('productMainPage'+s);
		init();
	}
}

function level3SoftwareOver()
{
	var s = document.getElementById('software'); 
	s.style.display='block';
	
	s = document.getElementById('hardware'); 
	s.style.display='none';
	
		
}

function level3HardwareOver()
{
	var s = document.getElementById('hardware'); 
	s.style.display='block';
	
	s = document.getElementById('software'); 
	s.style.display='none';
	
}

function userRegister()
{
	
}


window.onload=init;