

function addprod(qt,CodigoDoProduto,OrderId,ctrl,Comprar,TamanhosDiv,qtde12t,qtde13t,qtde14t,qtde15t,qtde16t,qtde17t,qtde18t,qtde19t,qtde20t,qtde21t,qtde22t,qtde23t,qtde24t,qtde25t,qtde26t,qtde27t,qtde28t) {

if (TamanhosDiv == 'S' && ctrl == 'bijouterias' && (qtde12t>0 || qtde13t>0 || qtde14t>0 || qtde15t>0 || qtde16t>0 || qtde17t>0 || qtde18t>0 || qtde19t>0 || qtde20t>0 || qtde21t>0 || qtde22t>0 || qtde23t>0 || qtde24t>0 || qtde25t>0 || qtde26t>0 || qtde27t>0 || qtde28t>0)) {

	selectbox = "<br>"
	selectbox = "<form name=\"formc\" action=\"addprod.asp?numOrder=" + OrderId + "\" method=\"POST\" onSubmit=\"return checkForm(this)\">"
// 	Se vier de i_geramostruário insere o controle abaixo
	if (ctrl == 'mostruario') {
		selectbox = selectbox + "<input type=\"hidden\" name=\"refererMostruario\" value=\"VeioDeMostruario\">"
	}
	
	selectbox = selectbox + 	"<input type=\"hidden\" name=\"item\" value=" + CodigoDoProduto + ">" 
	selectbox = selectbox + 	"<font size=\"2\" color=\"#000000\" face=\"Verdana\">Tamanho de aro desejado:</font><br><select NAME=\"tamanho\" SIZE=\"1\" onChange=\"updateqt(this.selectedIndex)\"  >"
	selectbox = selectbox + 	"<option SELECTED VALUE=0|0>"
if (qtde12t > 0) {
	selectbox = selectbox + "<option VALUE=" + qtde12t + "|12>12"
}
if (qtde13t > 0) {
	selectbox = selectbox + "<option VALUE=" + qtde13t + "|13>13"
}
if (qtde14t > 0) {
	selectbox = selectbox + "<option VALUE=" + qtde14t + "|14>14"
}
if (qtde15t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde15t + "|15>15"
}
if (qtde16t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde16t + "|16>16"
}
if (qtde17t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde17t + "|17>17"
}
if (qtde18t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde18t + "|18>18"
}
if (qtde19t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde19t + "|19>19"
}
if (qtde20t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde20t + "|20>20"
}
if (qtde21t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde21t + "|21>21"
}
if (qtde22t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde22t + "|22>22"
}
if (qtde23t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde23t + "|23>23"
}
if (qtde24t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde24t + "|24>24"
}
if (qtde25t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde25t + "|25>25"
}
if (qtde26t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde26t + "|26>26"
}
if (qtde27t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde27t + "|27>27"
}
if (qtde28t > 0) {
	selectbox = selectbox  + "<option VALUE=" + qtde28t + "|28>28"
}
	selectbox = selectbox + "</select>" 



	selectbox = selectbox + 	"<br><br><select NAME=\"qtde\" SIZE=\"1\">"

	selectbox = selectbox +	"<option SELECTED VALUE=\"1\">1"
if (qt > 1) {
	selectbox = selectbox + "<option VALUE=\"2\">2"}
if (qt > 2) {
	selectbox = selectbox + "<option VALUE=\"3\">3"
}
if (qt > 3) {
	selectbox = selectbox + "<option VALUE=\"4\">4"
}
if (qt > 4) {
	selectbox = selectbox  + "<option VALUE=\"5\">5"
}
if (qt > 5) {
	selectbox = selectbox  + "<option VALUE=\"6\">6"
}


	selectbox = selectbox + "</select>"

	selectbox = selectbox + " <input type=\"submit\" name=\"action\" value=" + Comprar + ">" +
	"</form>"


	return selectbox;

}

else if (TamanhosDiv == 'S' && ctrl == 'mostruario' && (qtde12t>0 || qtde13t>0 || qtde14t>0 || qtde15t>0 || qtde16t>0 || qtde17t>0 || qtde18t>0 || qtde19t>0 || qtde20t>0 || qtde21t>0 || qtde22t>0 || qtde23t>0 || qtde24t>0 || qtde25t>0 || qtde26t>0 || qtde27t>0 || qtde28t>0)) {

	selectbox = "<br>"
	selectbox = selectbox + 	"<font size=\"2\" face=\"Verdana\" color=\"#990000\"><br>Este modelo oferece a possibilidade de seleção de tamanho de aro.<br><b>Clique no nome do item para seleção do tamanho  desejado.</b></font><br><br>"

	return selectbox;


}

else if (TamanhosDiv != 'S')

{
	selectbox = "<br>"
	selectbox = "<form name=\"formc\" action=\"addprod.asp?numOrder=" + OrderId + "\" method=\"POST\">"
// 	Se vier de i_geramostruário insere o controle abaixo
	if (ctrl == 'mostruario') {
		selectbox = selectbox + "<input type=\"hidden\" name=\"refererMostruario\" value=\"VeioDeMostruario\">"
	}
	selectbox = selectbox + 	"<input type=\"hidden\" name=\"item\" value=" + CodigoDoProduto + ">" 

	selectbox = selectbox + 	"<select NAME=\"qtde\" SIZE=\"1\">" +
	"<option SELECTED VALUE=\"1\">1"
if (qt > 1) {
	selectbox = selectbox + "<option VALUE=\"2\">2"}
if (qt > 2) {
	selectbox = selectbox + "<option VALUE=\"3\">3"
}
if (qt > 3) {
	selectbox = selectbox + "<option VALUE=\"4\">4"
}
if (qt > 4) {
	selectbox = selectbox  + "<option VALUE=\"5\">5"
}
if (qt > 5) {
	selectbox = selectbox  + "<option VALUE=\"6\">6"
}
	selectbox = selectbox + "</select>" +
	" <input type=\"submit\" name=\"action\" value=" + Comprar + ">" +
	"</form>"

	return selectbox;

}

else

{

	selectbox = "<br>"
	selectbox = selectbox + 	"<font size=\"2\" face=\"Verdana\" color=\"#990000\"><br>Produto reservado!</font><br><br>"

	return selectbox;

}

}	

 function checkForm(formc) {


if(formc.tamanho.selectedIndex == 0) 
{ 
alert("ERRO: Escolha um tamanho de anel!");  
return false; 
} else { 
 return true; 
}

}



function updateqt(tamanhoSelec){

document.formc.qtde.options.length=0

var size = document.formc.tamanho.options[tamanhoSelec].value;
var mySplitResult = size.split("|");


if (mySplitResult[0] > 0) {
	document.formc.qtde.options[0]=new Option(1, 1, true, false)
}
if (mySplitResult[0] > 1) {
	document.formc.qtde.options[1]=new Option(2, 2, false, false)
}
if (mySplitResult[0] > 2) {
	document.formc.qtde.options[2]=new Option(3, 3, false, false)
}
if (mySplitResult[0] > 3) {
	document.formc.qtde.options[3]=new Option(4, 4, false, false)
}
if (mySplitResult[0] > 4) {
	document.formc.qtde.options[4]=new Option(5, 5, false, false)
}
if (mySplitResult[0] > 5) {
	document.formc.qtde.options[5]=new Option(6, 6, false, false)
}

}





function md() {

selectbox = "<form ACTION=\"subscribe.asp\" METHOD=\"post\"><a class=\"recblack\"><font face=\"arial\">" +
	"<input TYPE=\"hidden\" NAME=\"action\" VALUE=\"subscribe\"><br>" +
	"<div align=\"center\">Digite seu email:</font></a><br>" +
	"<input NAME=\"email\" VALUE=\"\" SIZE=\"20\" MAXLENGTH=\"100\"><br><input type=\"submit\" value=\"Enviar\" style=\"background-color: #000000; color: #FFFFFF; border-color: #ffffff\">" +
	"<input TYPE=\"hidden\" NAME=\"datafile\" VALUE=\"lista\"></form>"
	return selectbox;
	}

function busca() {

selectbox = "<FORM NAME=\"busca\" METHOD=POST ACTION=\"busca.asp\">" +
	"<INPUT TYPE=TEXT NAME=SearchText size=17 value =\"buscar palavras\" onFocus=\"document.busca.SearchText.value = '';\"><br>" +
	"<INPUT TYPE=SUBMIT VALUE=\"Procurar\">" +
	"</FORM>"
	return selectbox;
	}

function addbookmark()
{
bookmarkurl="http://www.pedradosol.com.br"
bookmarktitle="Pedra do Sol - Bijuterias para quem procura alternativas..."
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function Timer() {
setTimeout('windowProp()', 1800000);
}

function windowProp() {
alert ("ATENÇÃO: VOCÊ ESTÁ NESTA PÁGINA HÁ MAIS DE 30 MINUTOS.\n\nSUA SESSÃO PODERÁ SE EXPIRAR, E, CASO TENHA UMA COMPRA EM ANDAMENTO, A MESMA SERÁ PERDIDA!!!")
}

function Start(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=500,height=400");
}

function AbreJanela(URL,caract) {
  jan_popup = window.open(URL,'',caract);
}

function StartStreaming(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=268,height=320");
}

