/// Property of ITGenerations Inc ( Copy Right - 2001 )
//
// this cookie decode concept remeber last slide 
//
function getCookieVal (offset,endstr) {
if (endstr == null)
 		endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  	return unescape(document.cookie.substring(offset, endstr));
}

// this will return the specified name 


function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}


//  Function to create or update a cookie.
//    name - String object containing the cookie name.
//    value - String object containing the cookie value.  May contain
//      any valid string characters.
//    [expires] - Date object containing the expiration data of the cookie.  If
//      omitted or null, expires the cookie at the end of the current session.
//    [path] - String object indicating the path for which the cookie is valid.
//      If omitted or null, uses the path of the calling document.
//    [domain] - String object indicating the domain for which the cookie is
//      valid.  If omitted or null, uses the domain of the calling document.
//    [secure] - Boolean (true/false) value indicating whether cookie transmission
//      requires a secure channel (HTTPS).  
//

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "="  + value +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}



function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		b2b_over = newImage("../images/nav/b2b-over.gif");
		consult_over = newImage("../images/nav/consult-over.gif");
		develop_over = newImage("../images/nav/develop-over.gif");
		ecom_over = newImage("../images/nav/ecom-over.gif");
		wireless_over = newImage("../images/nav/wireless-over.gif");
		about_over = newImage("../images/header/about-over.gif");
		resource_over = newImage("../images/header/resource-over.gif");
		technical_over = newImage("../images/header/technical-over.gif");
		case_over = newImage("../images/header/case-over.gif");
		career_over = newImage("../images/header/career-over.gif");
		whitepaper_over = newImage("../images/header/whitepaper-over.gif");
		location_over = newImage("../images/header/location-over.gif");
		contact_over = newImage("../images/header/contact-over.gif");
	
		preloadFlag = true;
	}
}



//           window function ////////
		var hWnd = null;
	function Open_Window(page,wnd){
		var st = 'width=700,height=500,resizable=1,status=1,menubar=0,toolbar=1,location=0,scrollbars=0,left=50,top=50';
		if(hWnd == null)
			hWnd = window.open(page,wnd,st);
		else
		{
				hWnd.close();
				hWnd = window.open(page,wnd,st);
					
		}
	}