//Kontrola function image(upload) { if(!upload.tos.checked) { upload.tos.focus(); alert("You didn't agree to TOS"); return false; } if(!upload.content_type[0].checked && !upload.content_type[1].checked) { alert("You have to select a content type"); return false; } } //Dalsie polia var i = 5; function multiupload() { var viac = document.getElementById('viac'); if(!(i > 45)) { var j = i+4; while(i <= j) { viac.innerHTML += '
'; i++; } } } var ik = 4; var iks = 5; //CoverUpload function coverupload() { if(!(ik > "22")) { var viac = document.getElementById('viac'); viac.innerHTML += '

'; ik++;ik++; iks++;iks++; } } //CoverRemote function coverremote() { if(!(ik > "22")) { var viac = document.getElementById('viac'); viac.innerHTML += '

'; ik++;ik++; iks++;iks++; } } //Highlight function highlight(field) { field.focus(); field.select(); return true; } //Resize var actualWidth = 900; var actualHeight = 1927; var message; var b_fullsize=0; function tableWidth(minus) { return windowWidth()-minus; } function windowWidth() { if (navigator.appName=="Netscape") return window.innerWidth; return document.body.offsetWidth; } function scaleImg(minus) { what = document.getElementById('show_image'); actualHeight=what.height; actualWidth=what.width; if(fitsInWindow(minus)) return; if(what.width==tableWidth(minus)) { what.width=actualWidth; what.height=actualHeight; } else { what.style.cursor = "pointer"; what.width=tableWidth(minus); what.height = (actualHeight/actualWidth) * what.width; } } function showOnclick(minus) { what = document.getElementById('show_image'); if(actualWidth == what.width) return scaleImg(minus); else if(actualWidth > what.width) { what.width=actualWidth; what.height=actualHeight; } } function fitsInWindow(minus) { what = document.getElementById('show_image'); var actualWidth= what.width; if(actualWidth < tableWidth(minus)) { //displayWarning("none"); return true; } else { return false; } } $( document ).ready(function() { radioButtonName = 'content_type'; // console.log('type: ' + $('input[name="' + radioButtonName + '"]').attr('type')); if (!$('input[name="' + radioButtonName + '"]').is(':radio')) { // console.log("content_type is not a radio, " + 'input[name="' + radioButtonName + '"]'); radioButtonName = 'content_radio'; } content_type = $.cookie("content_type"); if(content_type == 0 || content_type == 1){ // console.log("cookies content type: "+content_type); // console.log("radioButtonName:" + radioButtonName); $('input[name="' + radioButtonName + '"][value="' + content_type + '"]').attr("checked", true); } $('input[name="' + radioButtonName + '"]').click(function() { // console.log( "content_type:" + $(this).val() ); val = $(this).val(); if(val == 0 || val == 1){ $.cookie("content_type", val, { expires : 3650, path : '/', domain : '.pixhost.org'}); } }); });;