function setCookie(nome, valor){
	document.cookie = nome + "=" + valor;
}
function getCookie(nome){
	if(document.cookie.indexOf(nome + "=")!=-1) return true;
	else return false;
}
function returnCookieValue(){
	var origem = '';
	var or = (document.location).href;
	
	if(getCookie("origem")){
		var csplit = document.cookie.split(";");
		for(i=0;i<csplit.length;i++){
			if(csplit[i].indexOf("origem")!=-1){
				var orig = csplit[i].split("origem=");
				origem = "?origem=" + orig[1];
			}
		}
	} else {
		origem = '?origem=PORTAL_IGBL_MIGRACAO';
	}
	
	if(or.indexOf("origem=")!=-1){
		var o = (document.location).href.split("origem=");
		setCookie("origem", o[1]);
		origem = "?origem=" + o[1];
	}
	return origem;
}
function wCase(part){
	var or = returnCookieValue();
	switch(part){
	case 'assinar-logo':
		link ='<a href="http://vendas.ig.com.br/vendas/vendas.do'+or+'"><img src="img/landing_01_01.jpg" width="377" height="113" border="0"></a>'
		break;
	case 'assinar-slogan':
		link ='<a href="http://vendas.ig.com.br/vendas/vendas.do'+or+'"><img src="img/landing_01_02.jpg" width="377" height="113" border="0"></a>'
		break;
	case 'assinar-botao':
		link ='<a href="http://vendas.ig.com.br/vendas/vendas.do'+or+'"><img src="img/landing_01_03.jpg" width="377" height="132" border="0"></a>'
		break;
}
	document.write(link);
}
function $(o){return document.getElementById(o);}